#1160
Se dă n
un număr natural nenul. Să se afle câte soluții are ecuația x
1
+x
2
+...+x
n
=0
în mulțimea {-1,0,1}
.
Problema | Necuatie | Operații I/O |
![]() necuatie.in /necuatie.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #56825233 | Utilizator | |
Fișier | necuatie.cpp | Dimensiune | 881 B |
Data încărcării | 06 Martie 2025, 22:38 | Scor / rezultat | Eroare de compilare |
necuatie.cpp:5:13: error: variable 'std::ifstream fin' has initializer but incomplete type ifstream fin("necuatie.in"); ^ necuatie.cpp:6:14: error: variable 'std::ofstream fout' has initializer but incomplete type ofstream fout("necuatie.out") ^ necuatie.cpp:7:1: error: expected ',' or ';' before 'const' const int MOD=555557; ^ necuatie.cpp: In function 'void factorial()': necuatie.cpp:14:29: error: 'MOD' was not declared in this scope fact[i]=fact[i-1]*i%MOD; ^ necuatie.cpp: In function 'long long int power(long long int, long long int)': necuatie.cpp:23:21: error: 'MOD' was not declared in this scope p=(p*a)%MOD; ^ necuatie.cpp:24:15: error: 'MOD' was not declared in this scope a=a*a%MOD; ^ necuatie.cpp: In function 'long long int combinari(int, int)': necuatie.cpp:35:25: error: 'MOD' was not declared in this scope return 1LL*(fact[n]%MOD*power(fact[n-k],MOD-2)%MOD*power(fact[k],MOD-2)%MOD)%MOD; ^ necuatie.cpp: In function 'int main()': necuatie.cpp:45:58: error: 'MOD' was not declared in this scope result=result+(combinari(2*i,n)*combinari(i,2*i)%MOD)%MOD; ^ necuatie.cpp: In function 'long long int combinari(int, int)': necuatie.cpp:36:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Necuatie 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ă.