Submission #1135151

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11351512025-01-11 22:02:35RaduMXor Sort (eJOI20_xorsort)C++20
60 / 100
4 ms972 KiB
#include <bits/stdc++.h>
using namespace std;
int v[1005];
map <int, int> mp;
vector < pair <int, int> > sol;
void divide(int st, int dr){
if(st == dr) return;
int b2 = -1, p = 0;
for(int i = st; i <= dr; i++){
if(31 - __builtin_clz(v[i]) > b2){
b2 = 31 - __builtin_clz(v[i]);
p = i;
}
}
if(b2 < 0) return;
for(int i = p; i < dr; i++){
if((1 << b2) & v[i + 1]){
sol.push_back({i, i + 1});
v[i] ^= v[i + 1];
}
else{
sol.push_back({i + 1, i});
v[i + 1] ^= v[i];
sol.push_back({i, i + 1});
v[i] ^= v[i + 1];
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...