#283
Secventa
Se dă un şir cu n
elemente, numere naturale. Determinaţi cea mai lungă secvenţă de elemente din şir cu proprietatea că oricare două valori consecutive în secvenţă au parităţi diferite.
Problema | Secventa | Operații I/O |
secventa.in /secventa.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50643004 | Utilizator | |
Fișier | secventa.cpp | Dimensiune | 1023 B |
Data încărcării | 18 Aprilie 2024, 11:00 | Scor / rezultat | Eroare de compilare |
secventa.cpp:3:1: error: 'ifstream' does not name a type ifstream in("secventa.in"); ^ secventa.cpp:4:1: error: 'ofstream' does not name a type ofstream out("secventa.out"); ^ secventa.cpp: In function 'int main()': secventa.cpp:8:5: error: 'in' was not declared in this scope in>>n; ^ secventa.cpp:15:13: error: 'k' was not declared in this scope k++; ^ secventa.cpp:16:13: error: 's' was not declared in this scope s=s+v[i+1]; ^ secventa.cpp:20:16: error: 'k' was not declared in this scope if(k==mx) ^ secventa.cpp:20:19: error: 'mx' was not declared in this scope if(k==mx) ^ secventa.cpp:21:20: error: 's' was not declared in this scope if(s>=smx) ^ secventa.cpp:27:16: error: 'k' was not declared in this scope if(k>mx) ^ secventa.cpp:27:18: error: 'mx' was not declared in this scope if(k>mx) ^ secventa.cpp:30:21: error: 's' was not declared in this scope smx=s; ^ secventa.cpp:34:13: error: 'k' was not declared in this scope k=1; ^ secventa.cpp:35:13: error: 's' was not declared in this scope s=v[i]; ^ secventa.cpp:37:12: error: 'k' was not declared in this scope if(k==mx) ^ secventa.cpp:37:15: error: 'mx' was not declared in this scope if(k==mx) ^ secventa.cpp:38:16: error: 's' was not declared in this scope if(s>=smx) ^ secventa.cpp:44:12: error: 'k' was not declared in this scope if(k>mx) ^ secventa.cpp:44:14: error: 'mx' was not declared in this scope if(k>mx) ^ secventa.cpp:47:17: error: 's' was not declared in this scope smx=s; ^ secventa.cpp:52:5: error: 'out' was not declared in this scope out<<p<<" "<<u; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Secventa 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ă.