Pagini recente » Borderou de evaluare (job #2433234) | Cod sursa (job #2899802) | Borderou de evaluare (job #1757208) | Borderou de evaluare (job #1942775) | Borderou de evaluare (job #2600491)
Borderou de evaluare (job #2600491)
Raport evaluator
Compilare:
main.cpp: In function 'void ADD(int)':
main.cpp:4: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))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:13:35: note: in expansion of macro 'zerous'
for(int i = poz; i <= n; i += zerous(i))
^~~~~~
main.cpp: In function 'int Query(int)':
main.cpp:4: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]++;
~~~~~~~~~~
}
| 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 | 3ms | 131kb | OK | 10 |
| 7 | 3ms | 131kb | OK | 10 |
| 8 | 185ms | 1703kb | OK | 10 |
| 9 | 163ms | 1703kb | OK | 10 |
| 10 | 373ms | 1703kb | OK | 10 |
| Punctaj total | 100 |