#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 | #54470730 | Utilizator | |
Fișier | five.cpp | Dimensiune | 876 B |
Data încărcării | 29 Noiembrie 2024, 11:34 | Scor / rezultat | Eroare de compilare |
five.cpp:15:27: error: declaration does not declare anything [-fpermissive] #define ULL unsigned long long; ^ five.cpp:17:1: note: in expansion of macro 'ULL' ULL v[6], sol; ^ five.cpp:17:5: error: 'v' does not name a type ULL v[6], sol; ^ five.cpp: In function 'int main()': five.cpp:15:27: error: declaration does not declare anything [-fpermissive] #define ULL unsigned long long; ^ five.cpp:20:5: note: in expansion of macro 'ULL' ULL n, w, x, y, z, a, i; ^ five.cpp:20:9: error: 'n' was not declared in this scope ULL n, w, x, y, z, a, i; ^ five.cpp:20:12: error: 'w' was not declared in this scope ULL n, w, x, y, z, a, i; ^ five.cpp:20:15: error: 'x' was not declared in this scope ULL n, w, x, y, z, a, i; ^ five.cpp:20:18: error: 'y' was not declared in this scope ULL n, w, x, y, z, a, i; ^ five.cpp:20:21: error: 'z' was not declared in this scope ULL n, w, x, y, z, a, i; ^ five.cpp:20:24: error: 'a' was not declared in this scope ULL n, w, x, y, z, a, i; ^ five.cpp:20:27: error: 'i' was not declared in this scope ULL n, w, x, y, z, a, i; ^ five.cpp:23:5: error: 'v' was not declared in this scope v[a%5]++; ^ five.cpp:30:5: error: 'sol' was not declared in this scope sol=v[0]*(v[0]-1)*(v[0]-2)/6; ^
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ă.