Submission #1074115

#TimeUsernameProblemLanguageResultExecution timeMemory
1074115beaconmcUnscrambling a Messy Bug (IOI16_messy)C++14
38 / 100
2 ms604 KiB
#include "messy.h" #include <bits/stdc++.h> typedef long long ll; #define FOR(i,x,y) for(ll i=x; i<y; i++) #define FORNEG(i,x,y) for(lli = x; i>y; i--) using namespace std; string sus(ll n, ll a, ll b){ string ans = ""; FOR(i,0,n){ if (i==a || i==b) ans += '1'; else ans += '0'; } return ans; } map<string, bool> checked; bool checks(string x){ if (checked.count(x)) return checked[x]; else return checked[x] = check_element(x); } std::vector<int> restore_permutation(int n, int w, int r) { ll cur = n; FOR(i,0,n){ if (cur > 0){ add_element(sus(n, i, i)); } FOR(j,1,cur){ add_element(sus(n, i, i+j)); } cur-=2; } compile_set(); vector<int> ans; FOR(i,0,n){ ll temp = 0; FOR(j,0,n){ temp += checks(sus(n, i, j)); } ans.push_back(n-temp); } 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...