Submission #1111132

#TimeUsernameProblemLanguageResultExecution timeMemory
1111132KLPPSphinx's Riddle (IOI24_sphinx)C++17
3 / 100
99 ms924 KiB
#include "sphinx.h" #include<bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i=a;i<b;i++) #define trav(a,v) for(auto a:v) typedef long long int lld; vector<int> ans; int n; void solve(int a, int b, vector<int> poss){ vector<int> nx; int expN=-1; if(true){ vector<int> V2; rep(i,0,n){ if(a<=i && i<=b)V2.push_back(-1); else V2.push_back(n); } expN=perform_experiment(V2); } // cout<<a<<" "<<b<<" "<<expN<<endl; trav(x,poss){ vector<int> V2; rep(i,0,n){ if(a<=i && i<=b)V2.push_back(-1); else V2.push_back(x); } int U=perform_experiment(V2); // cout<<U<<" "<<expN<<" "<<x<<endl; if(U<expN)nx.push_back(x); } if(a==b){ ans[a]=nx[0]; return; } int mid=(a+b)/2; solve(a,mid,nx); solve(mid+1,b,nx); } std::vector<int> find_colours(int N, std::vector<int> X, std::vector<int> Y) { n=N; ans.resize(n,0); vector<int> V; rep(i,0,n)V.push_back(i); int mid=(n-1)/2; solve(0,mid,V); solve(mid+1,n-1,V); // std::vector<int> E(N, -1); // int x = perform_experiment(E); // std::vector<int> G(N, 0); // if (x == 1) // G[0] = 1; 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...
#Verdict Execution timeMemoryGrader output
Fetching results...