# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
602936 | MohamedAhmed04 | Art Collections (BOI22_art) | C++17 | 780 ms | 760 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 "art.h"
#include <bits/stdc++.h>
using namespace std ;
int n ;
vector<int>v , vv ;
vector<int>get(int i , int j)
{
vv.clear() ;
for(int k = 0 ; k < j ; ++k)
vv.push_back(v[k]) ;
vv.push_back(v[i]) ;
for(int k = j ; k < i ; ++k)
vv.push_back(v[k]) ;
for(int k = i+1 ; k < n ; ++k)
vv.push_back(v[k]) ;
return vv ;
}
void solve(int N)
{
n = N ;
vector<int>v2 ;
for(int i = 1 ; i <= n ; ++i)
v.push_back(i) ;
int x = publish(v) ;
for(int i = 1 ; i < n ; ++i)
{
int l = 0 , r = i-1 ;
int idx = i ;
while(l <= r)
{
int mid = (l + r) >> 1 ;
v2 = get(i , mid) ;
if(publish(v2) == x-(i-mid))
idx = mid , r = mid-1 ;
else
l = mid+1 ;
}
v = get(i , idx) ;
x = publish(v) ;
}
answer(v) ;
}
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... |