# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
581253 | Meloric | Art Collections (BOI22_art) | C++17 | 1570 ms | 700 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "art.h"
#define pb push_back
//#define int int64_t
#define pii pair<int, int>
#define X first
#define Y second
#define all(x) (x).begin(),(x).end()
#define lb lower_bound
#define ub upper_bound
using namespace std;
//const int inf = 1e18;
void p(auto A){
for(auto e : A)cout << e << ' ';
cout << '\n';
}
vector<int> gen(int a, int N){
vector<int> ret;
ret.pb(a);
for(int i = 1; i<= N; i++){
if(i == a)continue;
ret.pb(i);
}
return ret;
}
void solve(int N){
int x = publish(gen(1, N));
vector<int> A(N+1);
for(int i = 2; i<= N; i++)A[i] = (publish(gen(i, N))-(x-i+1))/2;
vector<int> ans;
priority_queue<int> pq;
for(int i = 1; i<= N; i++)if(A[i] == 0)pq.push(i);
while(pq.size()){
int c = pq.top();
pq.pop();
ans.pb(c);
for(int i = c; i<= N; i++){
A[i]--;
if(A[i] == 0)pq.push(i);
}
}
answer(ans);
}
/*
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t = 1;
//cin >> t;
while(t--)solve();
}
*/
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |