#2619
five
Se consideră un șir de numere naturale a[1]
, a[2]
, …, a[n]
. Să se determine numărul tripletelor (a[i], a[j], a[p])
cu i < j < p
, iar a[i] + a[j] + a[p]
este divizibil cu 5
.
Folclorul informatic
Problema | five | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54470988 | Utilizator | |
Fișier | five.cpp | Dimensiune | 427 B |
Data încărcării | 29 Noiembrie 2024, 11:37 | Scor / rezultat | Eroare de compilare |
five.cpp: In function 'int main()': five.cpp:3:5: error: 'ULL' was not declared in this scope ULL n, w, x,y, z, a, i; ^ five.cpp:3:10: error: expected ';' before 'n' ULL n, w, x,y, z, a, i; ^ five.cpp:4:5: error: 'cin' was not declared in this scope cin>>n>>w>>x>>y>>y>>z; ^ five.cpp:4:10: error: 'n' was not declared in this scope cin>>n>>w>>x>>y>>y>>z; ^ five.cpp:4:13: error: 'w' was not declared in this scope cin>>n>>w>>x>>y>>y>>z; ^ five.cpp:4:16: error: 'x' was not declared in this scope cin>>n>>w>>x>>y>>y>>z; ^ five.cpp:4:19: error: 'y' was not declared in this scope cin>>n>>w>>x>>y>>y>>z; ^ five.cpp:4:25: error: 'z' was not declared in this scope cin>>n>>w>>x>>y>>y>>z; ^ five.cpp:6:5: error: 'v' was not declared in this scope v[a%5]++; ^ five.cpp:6:7: error: 'a' was not declared in this scope v[a%5]++; ^ five.cpp:7:9: error: 'i' was not declared in this scope for(i=2;i<=n;i++) ^ five.cpp:12:5: error: 'sol' was not declared in this scope sol=v[0]*(v[0-1])*(v[0]-2)/6 ^ five.cpp:13:5: error: expected ';' before 'sol' sol+=v[0]*v[1]*v[4]; ^ five.cpp:15:23: error: expected identifier before numeric constant sol+=v[1]*v[2]*v([2]-1)/2; ^ five.cpp: In lambda function: five.cpp:15:25: error: expected '{' before '-' token sol+=v[1]*v[2]*v([2]-1)/2; ^ five.cpp: In function 'int main()': five.cpp:15:25: error: no match for 'operator-' (operand types are 'main()::__lambda0' and 'int') five.cpp:16:23: error: expected identifier before numeric constant sol+=v[3]*v[1]*v([1]-1)/2; ^ five.cpp: In lambda function: five.cpp:16:25: error: expected '{' before '-' token sol+=v[3]*v[1]*v([1]-1)/2; ^ five.cpp: In function 'int main()': five.cpp:16:25: error: no match for 'operator-' (operand types are 'main()::__lambda1' and 'int') five.cpp:17:24: error: expected identifier before numeric constant sol+=v[2]*v[24]*v([4]-1)/2; ^ five.cpp: In lambda function: five.cpp:17:26: error: expected '{' before '-' token sol+=v[2]*v[24]*v([4]-1)/2; ^ five.cpp: In function 'int main()': five.cpp:17:26: error: no match for 'operator-' (operand types are 'main()::__lambda2' and 'int') five.cpp:18:23: error: expected identifier before numeric constant sol+=v[3]*v[3]*v([3]-1)/2; ^ five.cpp: In lambda function: five.cpp:18:25: error: expected '{' before '-' token sol+=v[3]*v[3]*v([3]-1)/2; ^ five.cpp: In function 'int main()': five.cpp:18:25: error: no match for 'operator-' (operand types are 'main()::__lambda3' and 'int') five.cpp:19:5: error: 'cout' was not declared in this scope cout<<sol; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema five 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ă.