#3556
Se dau numerele naturale n, x, y, z, t. Se generează vectorul a astfel: a[i] = (a[i-1] * x + y) % z, pentru 1 ≤ i ≤ n si a[i] = 0 pentru i = 0. Determinați ∑(a[i] XOR a[j]), unde 1 ≤ i < j ≤ n, modulo t.
| Problema | xorsum | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 1 MB
/
Stivă 1 MB
|
| Id soluție | #63816172 | Utilizator | |
| Fișier | xorsum.cpp | Dimensiune | 875 B |
| Data încărcării | 19 Martie 2026, 21:24 | Scor/rezultat | Eroare de compilare |
xorsum.cpp: In function 'int main()': xorsum.cpp:16:18: error: expected primary-expression before '__int128' a[i] = ((__int128)a[i-1] * x + y) % z; ^ xorsum.cpp:16:18: error: expected ')' before '__int128' xorsum.cpp:16:46: error: expected ')' before ';' token a[i] = ((__int128)a[i-1] * x + y) % z; ^ xorsum.cpp:29:9: error: expected primary-expression before '__int128' __int128 contrib = (__int128)(cnt0 % t) * (cnt1 % t) % t; ^ xorsum.cpp:29:9: error: expected ';' before '__int128' xorsum.cpp:30:9: error: 'contrib' was not declared in this scope contrib = contrib * (((__int128)1 << b) % t) % t; ^ xorsum.cpp:30:32: error: expected primary-expression before '__int128' contrib = contrib * (((__int128)1 << b) % t) % t; ^ xorsum.cpp:30:32: error: expected ')' before '__int128' xorsum.cpp:30:57: error: expected ')' before ';' token contrib = contrib * (((__int128)1 << b) % t) % t; ^ xorsum.cpp:30:57: error: expected ')' before ';' token xorsum.cpp:26:12: warning: unused variable 'cnt0' [-Wunused-variable] ll cnt0 = n - cnt1; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema xorsum 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ă.