Pagini recente » Cod sursa (job #2275464) | Borderou de evaluare (job #2659745) | Borderou de evaluare (job #1401881) | Borderou de evaluare (job #1565391) | Borderou de evaluare (job #2604266)
Borderou de evaluare (job #2604266)
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 |
| 1 | 2ms | 131kb | OK | 10 |
| 2 | 2ms | 131kb | OK | 10 |
| 3 | 3ms | 131kb | OK | 10 |
| 4 | 3ms | 131kb | OK | 10 |
| 5 | 3ms | 131kb | OK | 10 |
| 6 | 2ms | 131kb | OK | 10 |
| 7 | 2ms | 131kb | OK | 10 |
| 8 | 168ms | 1703kb | OK | 10 |
| 9 | 124ms | 1703kb | OK | 10 |
| 10 | 416ms | 1703kb | OK | 10 |
| Punctaj total | 100 |