Submission #894014

#TimeUsernameProblemLanguageResultExecution timeMemory
894014MalixUnscrambling a Messy Bug (IOI16_messy)C++14
0 / 100
1 ms600 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int,int> pi; #define REP(i,a,b) for(int i=a;i<b;i++) #define F first #define S second #define PB push_back #define MP make_pair #include "messy.h" int m=0; vi ans; void solve(int a, int b, string &s){ REP(i,0,m)s[i]='1'; REP(i,a,b)s[i]='0'; REP(i,a,(a+b)/2){ s[i]='1'; add_element(s); s[i]='0'; } } void check(int a, int b, string &s){ REP(i,0,m)s[i]='1'; REP(i,a,b)s[i]='0'; REP(i,a,b){ s[i]='1'; bool x=check_element(s); if(x==0)ans[i]=(a+b)/2; s[i]='0'; } } std::vector<int> restore_permutation(int n, int w, int r) { string s; m=n; ans.resize(n,0); REP(i,0,n)s.PB('0'); int k=n; int a=0,b=0; while(k>1){ a=0;b=k; while(b<=n){ solve(a,b,s); a+=k;b+=k; } k/=2; } // add_element("0"); compile_set(); k=n; while(k>1){ a=0;b=k; while(b<=n){ check(a,b,s); a+=k;b+=k; } k/=2; } //check_element("0"); return ans; // return std::vector<int>(); }
#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...