제출 #1044521

#제출 시각아이디문제언어결과실행 시간메모리
1044521fv3Unscrambling a Messy Bug (IOI16_messy)C++14
20 / 100
1 ms600 KiB
#include "messy.h" #include <bits/stdc++.h> using namespace std; vector<int> restore_permutation(int N, int W, int R) { // Try with different bitcounts: // 1000 // 1100 // 1110 // w = n - 1 // r = n*(n+1)/2 - 1 string element(N, '0'); for (int i = 0; i < N - 1; i++) { element[i] = '1'; add_element(element); } compile_set(); vector<int> perm(N, -1); string securedBits(N, '0'); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (securedBits[j] == '1') continue; securedBits[j] = '1'; if (check_element(securedBits)) { perm[i] = j; break; } securedBits[j] = '0'; } } int sum = 0; for (int i = 0; i < N - 1; i++) sum += perm[i]; perm.back() = (N * N - N) / 2 - sum; return perm; }
#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...