#2408
divtrei
Se consideră numerele naturale N
şi K
şi cifrele nenule distincte c[1]
, c[2]
, …, c[N]
. Să se determine câte numere de K
cifre formate doar cu cifrele c[1]
, c[2]
, …, c[N]
sunt divizibile cu 3
. Pentru că acest număr poate fi foarte mare, rezultatul se va determina modulo 4001
.
Problema | divtrei | Operații I/O |
divtrei.in /divtrei.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
Id soluție | #51077207 | Utilizator | |
Fișier | divtrei.cpp | Dimensiune | 676 B |
Data încărcării | 22 Mai 2024, 15:58 | Scor / rezultat | Eroare de compilare |
divtrei.cpp:8:16: error: conflicting declaration 'int f [3]' int n , k , f[3] , a[3] , b[3] , c; ^ divtrei.cpp:6:10: error: 'f' has a previous declaration as 'std::ifstream f' ifstream f("divtrei.in"); ^ divtrei.cpp: In function 'int main()': divtrei.cpp:15:10: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') f[c % 3]++; ^ divtrei.cpp:17:13: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') a[0] = f[0]; ^ divtrei.cpp:18:13: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') a[1] = f[1]; ^ divtrei.cpp:19:13: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') a[2] = f[2]; ^ divtrei.cpp:22:24: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') b[0] = a[0] * f[0] + a[1] * f[2] + a[2] * f[1]; ^ divtrei.cpp:22:38: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') b[0] = a[0] * f[0] + a[1] * f[2] + a[2] * f[1]; ^ divtrei.cpp:22:52: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') b[0] = a[0] * f[0] + a[1] * f[2] + a[2] * f[1]; ^ divtrei.cpp:23:24: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') b[1] = a[0] * f[1] + a[1] * f[0] + a[2] * f[2]; ^ divtrei.cpp:23:38: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') b[1] = a[0] * f[1] + a[1] * f[0] + a[2] * f[2]; ^ divtrei.cpp:23:52: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') b[1] = a[0] * f[1] + a[1] * f[0] + a[2] * f[2]; ^ divtrei.cpp:24:24: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') b[2] = a[0] * f[2] + a[1] * f[1] + a[2] * f[0]; ^ divtrei.cpp:24:38: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') b[2] = a[0] * f[2] + a[1] * f[1] + a[2] * f[0]; ^ divtrei.cpp:24:52: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') b[2] = a[0] * f[2] + a[1] * f[1] + a[2] * f[0]; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema divtrei 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ă.