Submission #1246139

#TimeUsernameProblemLanguageResultExecution timeMemory
1246139matsakyannnSphinx's Riddle (IOI24_sphinx)C++20
3 / 100
42 ms1184 KiB
#include <bits/stdc++.h> #include "sphinx.h" using namespace std; #ifndef ONLINE_JUDGE #define dbg(x) cerr << #x << ' '; print(x); cerr << endl; #else #define dbg(x) #endif void print(int x) {cerr << x;} void print(long long x) {cerr << x;} void print(char x) {cerr << x;} void print(string x) {cerr << x;} void print(double x) {cerr << x;} template <class T> void print(vector <T> x); template <class T> void print(set <T> x); template <class T> void print(multiset <T> x); template <class T, class V> void print(pair <T, V> x); template <class T, class V> void print(map <T, V> x); template <class T> void print(vector <T> x) {cerr << "[ "; for(auto i : x) {print(i); cerr << ' ';} cerr << "]";} template <class T> void print(set <T> x) {cerr << "[ "; for(auto i : x) {print(i); cerr << ' ';} cerr << "]";} template <class T> void print(multiset <T> x) {cerr << "[ "; for(auto i : x) {print(i); cerr << ' ';} cerr << "]";} template <class T, class V> void print(pair <T, V> x) {cerr << "{"; print(x.first); cerr << ' '; print(x.second); cerr << "}";} template <class T, class V> void print(map <T, V> x) {cerr << "[ "; for(auto i : x) {print(i); cerr << ' ';} cerr << "]";} #define ll long long #define pb push_back #define ppb pop_back #define PII pair <int, int> #define PLL pair <ll, ll> #define all(v) (v).begin(), (v).end() #define OK cerr << "OK\n"; #define MP make_pair const int N0 = 255; int n; vector <int> G[N0], E, answ; bool visited[N0]; vector<int> find_colours(int N, vector<int> X, vector<int> Y){ int n = N; for(int i = 0; i < X.size(); i++){ G[X[i]].pb(Y[i]); G[Y[i]].pb(X[i]); } E.assign(n, n); answ.resize(n); for(int i = 0; i < n - 1; i++){ E[i] = -1; for(int c = 0; c < n; c++){ E[i + 1] = c; int res = perform_experiment(E); if(res <= 2 - (n == 2)){ answ[i] = c; break; } } E[i] = n; E[i + 1] = n; } E[n - 1] = -1; for(int c = 0; c < n; c++){ E[0] = c; int res = perform_experiment(E); if(res <= 2 - (n == 2)){ answ[n - 1] = c; break; } } return answ; }
#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...