Pagini recente » Borderou de evaluare (job #3220948) | Borderou de evaluare (job #2411608) | Borderou de evaluare (job #645163) | Borderou de evaluare (job #2866129) | Borderou de evaluare (job #2553113)
Borderou de evaluare (job #2553113)
Raport evaluator
Compilare:
main.c: In function 'add':
main.c:3:31: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
#define zeros(x) (x ^ (x - 1) & x)
~~~~~~~~^~~~
int n, m, x, a, b;
~~~~~~~~~~~~~~~~~~
int aib[MAX];
~~~~~~~~~~~~~
void add(int *aib, int pos, int val) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for (int i = pos; i <= n; i += zeros(i))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:9:33: note: in expansion of macro 'zeros'
for (int i = pos; i <= n; i += zeros(i))
^~~~~
main.c: In function 'sum':
main.c:3:31: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
#define zeros(x) (x ^ (x - 1) & x)
~~~~~~~~^~~~
int n, m, x, a, b;
~~~~~~~~~~~~~~~~~~
int aib[MAX];
~~~~~~~~~~~~~
void add(int *aib, int pos, int val) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for (int i = pos; i <= n; i += zeros(i))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
aib[i] += val;
~~~~~~~~~~~~~~
}
~
int sum(int *aib, int pos) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
int res = 0;
~~~~~~~~~~~~
for (int i = pos; i > 0; i -= zeros(i))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:15:32: note: in expansion of macro 'zeros'
for (int i = pos; i > 0; i -= zeros(i))
^~~~~
Test |
Timp executie |
Memorie folosita |
Mesaj |
Punctaj/test |
1 | 2ms | 131kb | OK | 10 |
2 | 3ms | 131kb | OK | 10 |
3 | 12ms | 131kb | OK | 10 |
4 | 43ms | 262kb | OK | 10 |
5 | 95ms | 524kb | OK | 10 |
6 | 150ms | 655kb | OK | 10 |
7 | 139ms | 786kb | OK | 10 |
8 | 224ms | 917kb | OK | 10 |
9 | 210ms | 1048kb | OK | 10 |
10 | 220ms | 1048kb | OK | 10 |
Punctaj total | 100 |