Submission #65244

#TimeUsernameProblemLanguageResultExecution timeMemory
65244FedericoSUnscrambling a Messy Bug (IOI16_messy)C++14
38 / 100
3 ms428 KiB
#include <vector> #include <iostream> #include <assert.h> #include "messy.h" using namespace std; bool controlla(string g){ bool flag=check_element(g); //cout<<"controlla(\""<<g<<"\")="<<flag<<endl; return flag; } vector<int> restore_permutation(int N, int w, int r) { vector<int> P(N,-1); string S(N,'0'); for(int i=0;i<N;i++){ S[i]='1'; add_element(S); //cout<<S<<endl; } compile_set(); string R(N,'0'); for(int i=0;i<N;i++) for(int j=0;j<N;j++){ if(R[j]=='0'){ R[j]='1'; if(controlla(R)){ P[j]=i; break; } else R[j]='0'; } } return P; } /* 32 320 1024 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 */
#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...