Submission #734765

#TimeUsernameProblemLanguageResultExecution timeMemory
734765penguin133Unscrambling a Messy Bug (IOI16_messy)C++17
38 / 100
3 ms328 KiB
#include <bits/stdc++.h> using namespace std; #include "messy.h" //#define int long long #define pi pair<int, int> #define pii pair<int, pi> #define fi first #define se second #ifdef _WIN32 #define getchar_unlocked _getchar_nolock #endif mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); bool vis[130]; std::vector<int> restore_permutation(int n, int w, int r) { vector <int> ans; ans.resize(n); for(int i=0;i<n;i++){ string tmp = ""; for(int j=0;j<=i;j++)tmp += "1"; for(int j=i+1;j<n;j++)tmp += "0"; add_element(tmp); } compile_set(); for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(vis[j])continue; string tmp = ""; for(int k=0;k<n;k++){ if(k == j || vis[k])tmp += "1"; else tmp += "0"; } if(check_element(tmp)){ vis[j] = 1; ans[j] = i; break; } } } return ans; }
#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...