Submission #308454

#TimeUsernameProblemLanguageResultExecution timeMemory
308454juggernautUnscrambling a Messy Bug (IOI16_messy)C++14
49 / 100
1 ms384 KiB
#include"messy.h" #include<bits/stdc++.h> using namespace std; int id[1<<7],i,cnt; vector<int>restore_permutation(int n,int w,int r){ iota(id,id+n,0); vector<int>ans(n); string s(n,'0'); for(i=0;i<n;i++){ s[i]++; add_element(s); } srand(time(0)); random_shuffle(id,id+n); fill(s.begin(),s.end(),'0'); compile_set(); while(n-cnt) for(i=0;i<n;i++) if(s[id[i]]=='0'){ s[id[i]]++; if(check_element(s)){ ans[id[i]]=cnt++; break; }else s[id[i]]--; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...