#596
Gigel a găsit un șir cu n numere naturale. În fiecare zi Gigel parcurge șirul și când găsește o pereche de elemente consecutive egale o elimină din șir și se oprește. Determinați în câte zile va elimina Gigel elemente din șir și care sunt valorile din șir după eliminări.
| Problema | Numere2 | Operații I/O |
numere2.in/numere2.out
|
|---|---|---|---|
| Limita timp | 0.05 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64947313 | Utilizator | |
| Fișier | numere2.cpp | Dimensiune | 1.33 KB |
| Data încărcării | 20 Iunie 2026, 16:44 | Scor/rezultat | Eroare de compilare |
numere2.cpp: In function ‘void Ex(int&, int*, int&)’: numere2.cpp:35:40: error: expected primary-expression before ‘;’ token 35 | for(int i=1;i<=n && azi==false;;i++) | ^ numere2.cpp:35:40: error: expected ‘)’ before ‘;’ token 35 | for(int i=1;i<=n && azi==false;;i++) | ~ ^ | ) numere2.cpp:35:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 35 | for(int i=1;i<=n && azi==false;;i++) | ^~~ numere2.cpp:35:41: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 35 | for(int i=1;i<=n && azi==false;;i++) | ^ numere2.cpp:35:41: error: ‘i’ was not declared in this scope numere2.cpp:48:1: error: a function-definition is not allowed here before ‘{’ token 48 | { | ^ numere2.cpp:56:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 56 | int main() | ^~ numere2.cpp:56:9: note: remove parentheses to default-initialize a variable 56 | int main() | ^~ | -- numere2.cpp:56:9: note: or replace parentheses with braces to value-initialize a variable numere2.cpp:57:1: error: a function-definition is not allowed here before ‘{’ token 57 | { | ^ numere2.cpp:69:2: error: expected ‘}’ at end of input 69 | } | ^ numere2.cpp:30:1: note: to match this ‘{’ 30 | { | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Numere2 face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.