#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 | #36301578 | Utilizator | |
Fișier | five.cpp | Dimensiune | 1.10 KB |
Data încărcării | 14 Aprilie 2022, 16:34 | Scor / rezultat | Eroare de compilare |
five.cpp: In function 'int main()': five.cpp:16:22: error: expected ')' before 'X' a[i] = (1LL X a[i - 1] + Y) % Z; ^ five.cpp:25:34: error: expected ')' before 'fr' ans += (1LL fr[i] (fr[i] - 1) * (fr[i] - 2))/ 6; ^ five.cpp:27:52: error: expression cannot be used as a function ans += (1LL (fr[i] (fr[i] - 1) / 2) * fr[k]); ^ five.cpp:27:57: error: expression cannot be used as a function ans += (1LL (fr[i] (fr[i] - 1) / 2) * fr[k]); ^ five.cpp:29:54: error: expression cannot be used as a function ans += (1LL (fr[i] (fr[i] - 1) / 2) * fr[j]); ^ five.cpp:29:59: error: expression cannot be used as a function ans += (1LL (fr[i] (fr[i] - 1) / 2) * fr[j]); ^ five.cpp:31:52: error: expression cannot be used as a function ans += (1LL (fr[j] (fr[j] - 1) / 2) * fr[i]); ^ five.cpp:31:57: error: expression cannot be used as a function ans += (1LL (fr[j] (fr[j] - 1) / 2) * fr[i]); ^ five.cpp:33:36: error: expected ')' before 'fr' ans += (1LL fr[i] fr[j] * fr[k]); ^ five.cpp:9:10: warning: unused variable 's' [-Wunused-variable] int s; ^
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ă.