Submission #1088661

#TimeUsernameProblemLanguageResultExecution timeMemory
1088661T0p_Unscrambling a Messy Bug (IOI16_messy)C++14
38 / 100
2 ms604 KiB
#include "messy.h" #include <bits/stdc++.h> using namespace std; vector<int> restore_permutation(int n, int w, int r) { for (int i=0 ; i<n-1 ; i++) { string element = ""; for (int j=0 ; j<n ; j++) { element += j <= i ? '1' : '0'; } add_element(element); } compile_set(); vector<int> p(n, -1); vector<bool> is_one(n, false); for (int i=0 ; i<n-1 ; i++) { for (int j=0 ; j<n ; j++) { if (is_one[j]) { continue; } string element = ""; for (int k=0 ; k<n ; k++) { element += is_one[k] || k == j ? '1' : '0'; } if (check_element(element)) { is_one[j] = true; p[j] = i; break; } } } for (int i=0 ; i<n ; i++) { if (p[i] == -1) { p[i] = n - 1; } } 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...