제출 #1126883

#제출 시각아이디문제언어결과실행 시간메모리
1126883vladiliusArt Collections (BOI22_art)C++20
100 / 100
1085 ms496 KiB
#include <bits/stdc++.h> #include "art.h" using namespace std; using ll = long long; using pii = pair<int, int>; #define pb push_back #define ff first #define ss second void solve(int n){ vector<int> b; for (int i = 1; i <= n; i++){ b.pb(i); } int u = publish(b); for (int i = 2; i <= n; i++){ vector<int> c = {i}; for (int j = 1; j < i; j++){ c.pb(b[j - 1]); } for (int j = i + 1; j <= n; j++){ c.pb(b[j - 1]); } int v = publish(c); int S = (v + u - (i - 1)) / 2; int x = u - S; x = (i - 1) - x; b.erase(b.begin() + (i - 1)); b.insert(b.begin() + x, i); u -= ((i - 1) - x); } answer(b); }
#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...