Submission #109557

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1095572019-05-07 05:00:30nvmdavaJousting tournament (IOI12_tournament)C++17
0 / 100
202 ms3368 KiB
#include <bits/stdc++.h>
using namespace std;
#define BIG 131072
int fen[BIG];
int in[BIG];
int p[BIG];
int last[BIG];
int ans[BIG];
int find(int v){
return in[v] == 1 ? v : p[v] = find(p[v]);
}
void upd(int loc){
while(loc < BIG){
fen[loc]++;
loc += loc & -loc;
}
}
int sum(int loc){
int res = 0;
while(loc){
res += fen[loc];
loc -= loc & -loc;
}
return res;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

tournament.cpp: In function 'int GetBestPosition(int, int, int, int*, int*, int*)':
tournament.cpp:76:16: warning: iteration 131071 invokes undefined behavior [-Waggressive-loop-optimizations]
         ans[i] += ans[i - 1];
         ~~~~~~~^~~~~~~~~~~~~
tournament.cpp:75:22: note: within this loop
     for(int i = 1; i <= BIG; i++){
                      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...