Borderou de evaluare (job #2604266)

Utilizator matei123Biciusca Matei matei123 Data 22 aprilie 2020 12:19:50
Problema PermutariAB Status done
Runda Arhiva de probleme Compilator cpp-64 | Vezi sursa
Scor 100

Raport evaluator

Compilare: main.cpp: In function 'void ADD(int)': main.cpp:3:32: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses] #define zerous(x) (x ^ (x - 1) & x) ~~~~~~~~^~~~~ using namespace std; ~~~~~~~~~~~~~~~~~~~~~ ifstream fin("permutariab.in"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ofstream fout("permutariab.out"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ int n, AIB[NMAX], pz[NMAX], a[NMAX], b[NMAX]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void ADD(int poz) ~~~~~~~~~~~~~~~~~~ { for(int i = poz; i <= n; i += zerous(i)) AIB[i]++; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.cpp:9:35: note: in expansion of macro 'zerous' { for(int i = poz; i <= n; i += zerous(i)) AIB[i]++; } ^~~~~~ main.cpp: In function 'int Query(int)': main.cpp:3:32: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses] #define zerous(x) (x ^ (x - 1) & x) ~~~~~~~~^~~~~ using namespace std; ~~~~~~~~~~~~~~~~~~~~~ ifstream fin("permutariab.in"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ofstream fout("permutariab.out"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ int n, AIB[NMAX], pz[NMAX], a[NMAX], b[NMAX]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void ADD(int poz) ~~~~~~~~~~~~~~~~~~ { for(int i = poz; i <= n; i += zerous(i)) AIB[i]++; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ int Query(int poz) ~~~~~~~~~~~~~~~~~~~ { int rez = 0; ~~~~~~~~~~~~~~~~~ for(int i = poz; i >= 1; i -= zerous(i)) rez += AIB[i]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.cpp:12:35: note: in expansion of macro 'zerous' for(int i = poz; i >= 1; i -= zerous(i)) rez += AIB[i]; ^~~~~~
Test Timp executie Memorie folosita Mesaj Punctaj/test
12ms131kbOK10
22ms131kbOK10
33ms131kbOK10
43ms131kbOK10
53ms131kbOK10
62ms131kbOK10
72ms131kbOK10
8168ms1703kbOK10
9124ms1703kbOK10
10416ms1703kbOK10
Punctaj total100

Ceva nu functioneaza?