Borderou de evaluare (job #2930921)

Utilizator victorzarzuZarzu Victor victorzarzu Data 29 octombrie 2022 20:27:52
Problema Arbori indexati binar Status done
Runda Arhiva educationala Compilator cpp-64 | Vezi sursa
Scor 100

Raport evaluator

Compilare: main.cpp: In function 'void update(int, int)': main.cpp:5:32: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses] 5 | #define zeros(x) ((x ^ (x - 1) & x)) | ~~~~~~~~^~~~~ 6 | | 7 | using namespace std; | ~~~~~~~~~~~~~~~~~~~~ 8 | ifstream f("aib.in"); | ~~~~~~~~~~~~~~~~~~~~~ 9 | ofstream g("aib.out"); | ~~~~~~~~~~~~~~~~~~~~~~ 10 | int n, m; | ~~~~~~~~~ 11 | int aib[N]; | ~~~~~~~~~~~ 12 | | 13 | void update(int value, int position) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 14 | for(int i = position;i <= n;i += zeros(i)) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.cpp:14:36: note: in expansion of macro 'zeros' 14 | for(int i = position;i <= n;i += zeros(i)) { | ^~~~~ main.cpp: In function 'int query(int)': main.cpp:5:32: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses] 5 | #define zeros(x) ((x ^ (x - 1) & x)) | ~~~~~~~~^~~~~ 6 | | 7 | using namespace std; | ~~~~~~~~~~~~~~~~~~~~ 8 | ifstream f("aib.in"); | ~~~~~~~~~~~~~~~~~~~~~ 9 | ofstream g("aib.out"); | ~~~~~~~~~~~~~~~~~~~~~~ 10 | int n, m; | ~~~~~~~~~ 11 | int aib[N]; | ~~~~~~~~~~~ 12 | | 13 | void update(int value, int position) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 14 | for(int i = position;i <= n;i += zeros(i)) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 15 | aib[i] += value; | ~~~~~~~~~~~~~~~~ 16 | }
Test Timp executie Memorie folosita Mesaj Punctaj/test
10ms184kbOK10
21ms184kbOK10
30ms184kbOK10
49ms442kbOK10
524ms606kbOK10
638ms827kbOK10
742ms888kbOK10
857ms1069kbOK10
958ms1028kbOK10
1057ms1024kbOK10
Punctaj total100

Ceva nu functioneaza?