| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 919526 | Alihan_8 | 사육제 (CEOI14_carnival) | C++17 | 3 ms | 692 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define ar array
#define pb push_back
#define ln '\n'
#define int long long
using i64 = long long;
template <class F, class _S>
bool chmin(F &u, const _S &v){
bool flag = false;
if ( u > v ){
u = v; flag |= true;
}
return flag;
}
template <class F, class _S>
bool chmax(F &u, const _S &v){
bool flag = false;
if ( u < v ){
u = v; flag |= true;
}
return flag;
}
int query(auto a){
cout << a.size() << ' ';
for ( auto &x: a ){
cout << x + 1 << " ";
} cout << ln;
int c; cin >> c;
return c;
}
void answer(auto &a){
cout << "0 ";
for ( auto &x: a ){
cout << x << " ";
} exit(0);
}
signed main(){
// ios_base::sync_with_stdio(false);
// cin.tie(nullptr);
int n; cin >> n;
vector <vector<int>> a;
auto f = [&](int l, int r, int q){
vector <int> t(1, q);
for ( int i = l; i < r; i++ ){
t.pb(a[i].back());
}
return query(t);
};
for ( int i = 0; i < n; i++ ){
if ( f(0, (int)a.size(), i) == a.size() + 1 ){
a.pb({i});
continue;
}
int l = 0, r = (int)a.size() - 1;
while ( l < r ){
int md = (l + r) >> 1;
if ( f(l, md, i) == md - l + 2 ){
l = md + 1;
} else r = md;
}
a[l].pb(i);
}
vector <int> c(n);
int it = 0;
for ( auto &x: a ){
++it;
for ( auto &i: x ){
c[i] = it;
}
}
answer(c);
cout << '\n';
}
컴파일 시 표준 에러 (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... | ||||
