제출 #21885

#제출 시각아이디문제언어결과실행 시간메모리
21885sampritiUnscrambling a Messy Bug (IOI16_messy)C++14
38 / 100
3 ms384 KiB
#include "messy.h" #include <vector> #include <string> using namespace std; std::vector<int> restore_permutation(int N, int w, int r) { vector<string> els; for(int i = 0; i < N; i++) { string str = ""; for(int j = 0; j < N; j++) { if(j <= i) str += '1'; else str += '0'; } add_element(str); els.push_back(str); } compile_set(); vector<int> P(N, -1); for(int i = 0; i < N; i++) { string curr = ""; for(int j = 0; j < N; j++) { if(P[j] != -1) curr += '1'; else curr += '0'; } for(int j = 0; j < N; j++) { if(curr[j] == '1') continue; curr[j] = '1'; if(check_element(curr)) { P[j] = i; break; } curr[j] = '0'; } } return P; }
#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...