#3512
Se dau n
numere naturale. Să se calculeze produsul factorialelor acestora, modulo 1.000.000.007
.
Problema | FactorialQuery | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.3 secunde | Limita memorie |
Total: 5 MB
/
Stivă 0.7 MB
|
Id soluție | #57737807 | Utilizator | |
Fișier | factorialquery.cpp | Dimensiune | 672 B |
Data încărcării | 13 Aprilie 2025, 15:21 | Scor / rezultat | Eroare de compilare |
factorialquery.cpp:3:18: error: expected initializer before numeric constant const int MODULO 1000000007LL ^ factorialquery.cpp: In function 'int main()': factorialquery.cpp:7:5: error: 'ios' has not been declared ios::sync_with_stdio(false); ^ factorialquery.cpp:8:5: error: 'cin' was not declared in this scope cin.tie(nullptr); ^ factorialquery.cpp:8:5: note: suggested alternative: In file included from factorialquery.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ factorialquery.cpp:12:5: error: 'vector' was not declared in this scope vector<int> v(n); ^ factorialquery.cpp:12:5: note: suggested alternative: In file included from /usr/include/c++/4.8/vector:64:0, from factorialquery.cpp:2: /usr/include/c++/4.8/bits/stl_vector.h:210:11: note: 'std::vector' class vector : protected _Vector_base<_Tp, _Alloc> ^ factorialquery.cpp:12:12: error: expected primary-expression before 'int' vector<int> v(n); ^ factorialquery.cpp:12:12: error: expected ';' before 'int' factorialquery.cpp:17:16: error: 'v' was not declared in this scope cin >> v[i]; ^ factorialquery.cpp:23:12: error: expected primary-expression before 'long' vector<long long> fact(maxi + 1, 1); ^ factorialquery.cpp:23:12: error: expected ';' before 'long' factorialquery.cpp:25:9: error: 'fact' was not declared in this scope fact[i] = (fact[i - 1] * i) % MODULO; ^ factorialquery.cpp:25:39: error: 'MODULO' was not declared in this scope fact[i] = (fact[i - 1] * i) % MODULO; ^ factorialquery.cpp:31:28: error: 'fact' was not declared in this scope produs = (produs * fact[v[i]]) % MODULO; ^ factorialquery.cpp:31:33: error: 'v' was not declared in this scope produs = (produs * fact[v[i]]) % MODULO; ^ factorialquery.cpp:31:42: error: 'MODULO' was not declared in this scope produs = (produs * fact[v[i]]) % MODULO; ^ factorialquery.cpp:34:5: error: 'cout' was not declared in this scope cout << produs << '\n'; ^ factorialquery.cpp:34:5: note: suggested alternative: In file included from factorialquery.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FactorialQuery 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ă.