# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
83827 | aminra | Carnival (CEOI14_carnival) | C++14 | 10 ms | 696 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double ld;
const int MAXN = (int)1e5 + 7;
const int infint = (int)1e9;
const int MOD = (int)1e9 + 9;
const ll inf = (ll)2e18 + 2;
int n, a[MAXN], tsz = 1;
int ask(vector<int> v)
{
cout << v.size() << " ";
for (auto u : v)
cout << u << " ";
cout << endl;
int get;
cin >> get;
return get;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin >> n;
a[1] = tsz;
vector<int> nws;
nws.push_back(1);
for (int i = 2; i <= n; i++)
{
nws.push_back(i);
int t = ask(nws);
if(t == nws.size())
{
a[i] = ++tsz;
continue;
}
else
{
nws.pop_back();
int L = -1, R = nws.size() - 1;
while(R - L > 1)
{
int mid = (R + L) >> 1;
vector<int> tmp;
for (int i = 0; i <= mid; i++)
tmp.push_back(nws[i]);
tmp.push_back(i);
int t = ask(tmp);
if(t == tmp.size() - 1)
R = mid;
else
L = mid;
}
a[i] = a[nws[R]];
}
}
cout << 0 << " ";
for (int i = 1; i <= n; i++)
cout << a[i] << " ";
cout << endl;
}
컴파일 시 표준 에러 (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... |