#3718
Tort2
Dându-se un șir de numere, se vrea să aflăm numărul de moduri de a împărți șirul în cel puțin două subsecvențe, astfel încât sumele elementelor tuturor subsecvențelor să fie egale, prima putând să aibă suma elementelor diferită de a celorlalte.
OJI 2021, clasa a X-a
Problema | Tort2 | Operații I/O |
tort.in /tort.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51998476 | Utilizator | |
Fișier | tort2.cpp | Dimensiune | 389 B |
Data încărcării | 15 Septembrie 2024, 15:12 | Scor / rezultat | Eroare de compilare |
tort2.cpp:4:14: warning: missing terminating " character [enabled by default] ifstream cin("tort.in); ^ tort2.cpp:4:1: error: missing terminating " character ifstream cin("tort.in); ^ tort2.cpp:5:15: warning: missing terminating " character [enabled by default] ofstream cout("tort.out); ^ tort2.cpp:5:1: error: missing terminating " character ofstream cout("tort.out); ^ tort2.cpp:6:7: error: 'i' has not been declared int n,i,a[200020],fr[200020],j,cnt; ^ tort2.cpp:6:9: error: 'a' has not been declared int n,i,a[200020],fr[200020],j,cnt; ^ tort2.cpp:6:19: error: 'fr' has not been declared int n,i,a[200020],fr[200020],j,cnt; ^ tort2.cpp:6:30: error: 'j' has not been declared int n,i,a[200020],fr[200020],j,cnt; ^ tort2.cpp:6:32: error: 'cnt' has not been declared int n,i,a[200020],fr[200020],j,cnt; ^ tort2.cpp:6:35: error: expected ')' before ';' token int n,i,a[200020],fr[200020],j,cnt; ^ tort2.cpp:6:35: error: expected ')' before ';' token tort2.cpp: In function 'int main()': tort2.cpp:9:7: error: 'n' was not declared in this scope cin>>n; ^ tort2.cpp:10:6: error: 'i' was not declared in this scope for(i=1;i<=n;i++){ ^ tort2.cpp:11:8: error: 'a' was not declared in this scope cin>>a[i]; ^ tort2.cpp:13:6: error: 'i' was not declared in this scope for(i=n;i>=1;i--){ ^ tort2.cpp:14:3: error: 'a' was not declared in this scope a[i]=a[i+1]+a[i]; ^ tort2.cpp:15:3: error: 'fr' was not declared in this scope fr[a[i]]=1; ^ tort2.cpp:17:6: error: 'i' was not declared in this scope for(i=n;i>1;i--){ ^ tort2.cpp:18:7: error: 'j' was not declared in this scope for(j=a[i];j<a[1];j++) ^ tort2.cpp:18:9: error: 'a' was not declared in this scope for(j=a[i];j<a[1];j++) ^ tort2.cpp:19:7: error: 'fr' was not declared in this scope if(fr[j]==1) ^ tort2.cpp:20:5: error: 'cnt' was not declared in this scope cnt++; ^ tort2.cpp:24:2: error: 'cout' was not declared in this scope cout<<cnt; ^ tort2.cpp:24:8: error: 'cnt' was not declared in this scope cout<<cnt; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Tort2 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ă.