Submission #624248

#TimeUsernameProblemLanguageResultExecution timeMemory
624248Icebear16Unscrambling a Messy Bug (IOI16_messy)C++14
20 / 100
1 ms212 KiB
#include <bits/stdc++.h> #include "messy.h" using namespace std; #define pb push_back #define pf push_front #define mp make_pair #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),ra.end() #define sz(a) a.size() std::vector<int> restore_permutation(int n, int w, int r) { vector<string> s(7,""); s[0]="10000000"; s[1]="11000000"; s[2]="11100000"; s[3]="11110000"; s[4]="11111000"; s[5]="11111100"; s[6]="11111110"; add_element(s[0]); add_element(s[1]); add_element(s[2]); add_element(s[3]); add_element(s[4]); add_element(s[5]); add_element(s[6]); compile_set(); vector<int> v(8,0); int ans1=0,ans2=0; for(int i=0;i<7;i++){ for(int j=i+1;j<8;j++){ for(int k=0;k<7;k++){ swap(s[k][i],s[k][j]); if(check_element(s[k])==false){ swap(s[k][i],s[k][j]); break; }else{ if(k==6){ ans1=i,ans2=j; break; } } swap(s[k][i],s[k][j]); } if(ans1!=ans2) break; } if(ans1!=ans2) break; } for(int i=0;i<8;i++){ if(i==ans1) v[i]=ans2; else if(i==ans2) v[i]=ans1; else v[i]=i; } return v; }
#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...