#1262
subsecv
Se dau n
numere naturale. Să se găsească o subsecvență astfel încât suma elementelor din această subsecvență să fie divizibilă cu n
.
Problema | subsecv | Operații I/O |
subsecv.in /subsecv.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 0.1 MB
/
Stivă 0.1 MB
|
Id soluție | #54391414 | Utilizator | |
Fișier | subsecv.cpp | Dimensiune | 726 B |
Data încărcării | 27 Noiembrie 2024, 12:35 | Scor / rezultat | Eroare de compilare |
subsecv.cpp:5:14: warning: missing terminating " character [enabled by default] ifstream fin("subsecv.in”); ^ subsecv.cpp:5:1: error: missing terminating " character ifstream fin("subsecv.in”); ^ subsecv.cpp:7:15: warning: missing terminating " character [enabled by default] ofstream fout("subsecv.out”); ^ subsecv.cpp:7:1: error: missing terminating " character ofstream fout("subsecv.out”); ^ subsecv.cpp:23:9: error: stray '\342' in program A[i] = (a[i – 1] + x % n) % n; ^ subsecv.cpp:23:9: error: stray '\200' in program subsecv.cpp:23:9: error: stray '\223' in program subsecv.cpp:31:13: error: stray '\342' in program if((a[j] – a[i – 1]) == 0) ^ subsecv.cpp:31:13: error: stray '\200' in program subsecv.cpp:31:13: error: stray '\223' in program subsecv.cpp:31:13: error: stray '\342' in program subsecv.cpp:31:13: error: stray '\200' in program subsecv.cpp:31:13: error: stray '\223' in program subsecv.cpp:51:17: warning: missing terminating " character [enabled by default] fout << "Nu exista”; ^ subsecv.cpp:51:9: error: missing terminating " character fout << "Nu exista”; ^ subsecv.cpp:3:1: error: 'Using' does not name a type Using namespace std; ^ subsecv.cpp:5:1: error: 'ifstream' does not name a type ifstream fin("subsecv.in”); ^ subsecv.cpp: In function 'int main()': subsecv.cpp:15:5: error: 'fin' was not declared in this scope fin >> n; ^ subsecv.cpp:15:12: error: 'n' was not declared in this scope fin >> n; ^ subsecv.cpp:21:16: error: 'x' was not declared in this scope fin >> x; ^ subsecv.cpp:23:9: error: 'A' was not declared in this scope A[i] = (a[i – 1] + x % n) % n; ^ subsecv.cpp:23:17: error: 'a' was not declared in this scope A[i] = (a[i – 1] + x % n) % n; ^ subsecv.cpp:23:25: error: expected ']' before numeric constant A[i] = (a[i – 1] + x % n) % n; ^ subsecv.cpp:23:25: error: expected ')' before numeric constant subsecv.cpp:27:31: error: 'ok' was not declared in this scope for(int i = 1; i <= n && !ok; i++) ^ subsecv.cpp:31:17: error: 'a' was not declared in this scope if((a[j] – a[i – 1]) == 0) ^ subsecv.cpp:31:26: error: expected ')' before 'a' if((a[j] – a[i – 1]) == 0) ^ subsecv.cpp:45:5: error: expected ')' before 'if' if(ok) ^ subsecv.cpp:51:9: error: 'fout' was not declared in this scope fout << "Nu exista”; ^ subsecv.cpp:53:5: error: expected primary-expression before 'return' return 0; ^ subsecv.cpp:53:5: error: expected ';' before 'return'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema subsecv 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ă.