#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 | #63376386 | Utilizator | |
| Fișier | xorsum.cpp | Dimensiune | 3.41 KB |
| Data încărcării | 28 Februarie 2026, 17:26 | Scor/rezultat | Eroare de compilare |
xorsum.cpp:45:1: error: stray '\`' in program \`\`\` ^ xorsum.cpp:45:1: error: stray '\`' in program xorsum.cpp:45:1: error: stray '\`' in program xorsum.cpp:47:1: error: stray '\`' in program \`\`\`python ^ xorsum.cpp:47:1: error: stray '\`' in program xorsum.cpp:47:1: error: stray '\`' in program xorsum.cpp:81:1: error: stray '\`' in program \`\`\` ^ xorsum.cpp:81:1: error: stray '\`' in program xorsum.cpp:81:1: error: stray '\`' in program xorsum.cpp:83:1: error: stray '\`' in program \`\`\`swift ^ xorsum.cpp:83:1: error: stray '\`' in program xorsum.cpp:83:1: error: stray '\`' in program xorsum.cpp:86:1: error: stray '@' in program @inline(__always) ^ xorsum.cpp:96:1: error: stray '@' in program @inline(__always) ^ xorsum.cpp:133:18: error: too many decimal points in number for _ in 1...n { ^ xorsum.cpp:137:22: error: too many decimal points in number for b in 0..<62 { ^ xorsum.cpp:147:14: error: too many decimal points in number for b in 0..<62 { ^ xorsum.cpp:5:14: error: expected type-specifier before '__uint128_t' using u128 = __uint128_t; ^ xorsum.cpp: In function 'int main()': xorsum.cpp:23:26: error: 'u128' was not declared in this scope u64 ai = (u64)(((u128)prev * x + y) % z); ^ xorsum.cpp:23:31: error: expected ')' before 'prev' u64 ai = (u64)(((u128)prev * x + y) % z); ^ xorsum.cpp:23:49: error: expected ')' before ';' token u64 ai = (u64)(((u128)prev * x + y) % z); ^ xorsum.cpp:35:9: error: 'u128' was not declared in this scope u128 pairs = (u128)ones * zeros; ^ xorsum.cpp:35:14: error: expected ';' before 'pairs' u128 pairs = (u128)ones * zeros; ^ xorsum.cpp:36:30: error: 'pairs' was not declared in this scope u64 contrib = (u64)((pairs % t) * pow2mod % t); ^ xorsum.cpp:39:31: error: expected ')' before 'pow2mod' pow2mod = (u64)((u128)pow2mod * 2 % t); ^ xorsum.cpp:34:13: warning: unused variable 'zeros' [-Wunused-variable] u64 zeros = n - ones; ^ xorsum.cpp: At global scope: xorsum.cpp:47:4: error: 'python' does not name a type \`\`\`python ^ xorsum.cpp:97:1: error: expected initializer before 'func' func mulMod(_ aIn: UInt64, _ bIn: UInt64, _ mod: UInt64) -> UInt64 { ^
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ă.