#297
SecvSumMax
Se dă un şir cu n
elemente, numere întregi. Determinaţi secvenţa de elemente cu suma maximă.
Problema | SecvSumMax | Operații I/O |
secvsummax.in /secvsummax.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #49649386 | Utilizator | |
Fișier | secvsummax.cpp | Dimensiune | 544 B |
Data încărcării | 11 Martie 2024, 10:48 | Scor / rezultat | Eroare de compilare |
secvsummax.cpp:3:13: error: variable 'std::ifstream fin' has initializer but incomplete type ifstream fin("secvsummax.in") ^ secvsummax.cpp:4:1: error: expected ',' or ';' before 'ofstream' ofstream fout("secvsummax.out") ^ secvsummax.cpp: In function 'int main()': secvsummax.cpp:8:10: error: 'n' was not declared in this scope fin>>n; ^ secvsummax.cpp:9:10: error: 'i' was not declared in this scope for (i=1;i<=n;i++) ^ secvsummax.cpp:11:14: error: 'v' was not declared in this scope fin>>v[i]; ^ secvsummax.cpp:13:10: error: 'i' was not declared in this scope for (i=1;i<=n;i++) ^ secvsummax.cpp:15:13: error: 's' was not declared in this scope if (s<0) ^ secvsummax.cpp:18:13: error: 'start' was not declared in this scope start=i; ^ secvsummax.cpp:20:9: error: 's' was not declared in this scope s+=v[i]; ^ secvsummax.cpp:20:12: error: 'v' was not declared in this scope s+=v[i]; ^ secvsummax.cpp:21:15: error: 'smax' was not declared in this scope if (s>smax) ^ secvsummax.cpp:24:13: error: 'st' was not declared in this scope st=start; ^ secvsummax.cpp:24:16: error: 'start' was not declared in this scope st=start; ^ secvsummax.cpp:25:13: error: 'dr' was not declared in this scope dr=i; ^ secvsummax.cpp:28:5: error: 'fout' was not declared in this scope fout<<st<<" "<<dr; ^ secvsummax.cpp:28:11: error: 'st' was not declared in this scope fout<<st<<" "<<dr; ^ secvsummax.cpp:28:20: error: 'dr' was not declared in this scope fout<<st<<" "<<dr; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SecvSumMax 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ă.