Borderou de evaluare (job #2875244)

Utilizator alexmorosanuMorosanu Alexandru alexmorosanu Data 21 martie 2022 12:38:42
Problema Datorii Status done
Runda Arhiva de probleme Compilator cpp-64 | Vezi sursa
Scor 100

Raport evaluator

Compilare: main.cpp: In function 'void update(int, int)': main.cpp:2:26: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses] 2 | #define zeros(x) (x^(x-1)&x) | ~~~~~^~~ 3 | using namespace std; | ~~~~~~~~~~~~~~~~~~~~ 4 | ifstream f("datorii.in"); | ~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | ofstream g("datorii.out"); | ~~~~~~~~~~~~~~~~~~~~~~~~~~ 6 | int a[15011],n; | ~~~~~~~~~~~~~~~ 7 | void update(int k,int val) | ~~~~~~~~~~~~~~~~~~~~~~~~~~ 8 | { | ~ 9 | while(k<=n) | ~~~~~~~~~~~ 10 | { | ~ 11 | a[k]=a[k]+val; | ~~~~~~~~~~~~~~ 12 | k=k+zeros(k); | ~~~~~~~~~~~ main.cpp:12:13: note: in expansion of macro 'zeros' 12 | k=k+zeros(k); | ^~~~~ main.cpp: In function 'int query(int)': main.cpp:2:26: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses] 2 | #define zeros(x) (x^(x-1)&x) | ~~~~~^~~ 3 | using namespace std; | ~~~~~~~~~~~~~~~~~~~~ 4 | ifstream f("datorii.in"); | ~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | ofstream g("datorii.out"); | ~~~~~~~~~~~~~~~~~~~~~~~~~~ 6 | int a[15011],n; | ~~~~~~~~~~~~~~~ 7 | void update(int k,int val) | ~~~~~~~~~~~~~~~~~~~~~~~~~~ 8 | { | ~ 9 | while(k<=n) | ~~~~~~~~~~~ 10 | { | ~ 11 | a[k]=a[k]+val; | ~~~~~~~~~~~~~~ 12 | k=k+zeros(k);
Test Timp executie Memorie folosita Mesaj Punctaj/test
188ms712kbCorect!20
288ms712kbCorect!20
388ms712kbCorect!20
488ms712kbCorect!20
588ms712kbCorect!20
Punctaj total100

Ceva nu functioneaza?