# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
572913 | 2022-06-05T13:29:50 Z | AmirElarbi | Art Collections (BOI22_art) | C++17 | 3 ms | 208 KB |
#include <bits/stdc++.h> #define vi vector<int> #define ve vector #define ll long long #define vf vector<float> #define vll vector<pair<ll,ll>> #define ii pair<int,int> #define vvi vector<vi> #define vii vector<ii> #define gii greater<ii> #define pb push_back #define mp make_pair #define fi first #define se second #define INF 1e9 #define eps 1e-7 #define eps1 1e-2 #define optimise ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define MAX_A 2e5+5 using namespace std; const int MOD = 1e4+7; const int nax = 5e3+7; #include "art.h" typedef complex<int> Point; #define X real() #define Y imag() void solve(int N) { int n = N; int ans[N]; vi order; for (int j = 1; j <= n; ++j) { ans[j] = -1; order.pb(j); } int init = publish(order); set<int> st; for (int i = 1; i <= n; ++i) { order.clear(); for (int j = 1; j <= n; ++j) { if(i!=j) order.pb(j); } order.pb(i); int ans2 = publish(order); int diff = init-ans2+(n-i); int lst = -1, nb = 0; for (auto x : st) { if(x-1 != lst && diff/2 < x){ break; } nb++; lst = x; } ans[diff/2+nb] = i; st.insert(diff/2+nb); } vi res; for (int i = 0; i < n; ++i) { if(ans[i]==-1) ans[i] = n; res.pb(ans[i]); } answer(res); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | Output is correct |
2 | Correct | 3 ms | 208 KB | Output is correct |
3 | Correct | 0 ms | 208 KB | Output is correct |
4 | Correct | 1 ms | 208 KB | Output is correct |
5 | Incorrect | 0 ms | 208 KB | Not correct |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | Output is correct |
2 | Correct | 3 ms | 208 KB | Output is correct |
3 | Correct | 0 ms | 208 KB | Output is correct |
4 | Correct | 1 ms | 208 KB | Output is correct |
5 | Incorrect | 0 ms | 208 KB | Not correct |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | Output is correct |
2 | Correct | 3 ms | 208 KB | Output is correct |
3 | Correct | 0 ms | 208 KB | Output is correct |
4 | Correct | 1 ms | 208 KB | Output is correct |
5 | Incorrect | 0 ms | 208 KB | Not correct |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | Output is correct |
2 | Correct | 3 ms | 208 KB | Output is correct |
3 | Correct | 0 ms | 208 KB | Output is correct |
4 | Correct | 1 ms | 208 KB | Output is correct |
5 | Incorrect | 0 ms | 208 KB | Not correct |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | Output is correct |
2 | Correct | 3 ms | 208 KB | Output is correct |
3 | Correct | 0 ms | 208 KB | Output is correct |
4 | Correct | 1 ms | 208 KB | Output is correct |
5 | Incorrect | 0 ms | 208 KB | Not correct |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | Output is correct |
2 | Correct | 3 ms | 208 KB | Output is correct |
3 | Correct | 0 ms | 208 KB | Output is correct |
4 | Correct | 1 ms | 208 KB | Output is correct |
5 | Incorrect | 0 ms | 208 KB | Not correct |
6 | Halted | 0 ms | 0 KB | - |