# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
306523 | waterfall | 사육제 (CEOI14_carnival) | C++11 | 8 ms | 256 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define vi vector<int>
#define mii map<int,int>
#define pqb priority_queue<int>
#define pqs priority_queue<int,vi,greater<int> >
#define setbits(x) __builtin_popcountll(x)
#define zrobits(x) __builtin_ctzll(x)
#define mod 1000000007
#define inf 1e18
#define ps(x,y) fixed<<setprecision(y)<<x
#define mk(arr,n,type) type *arr=new type[n];
#define w(x) int x; cin>>x; while(x--)
int N;
int colors[152];
int32_t main()
{
cin >> N;
colors[1] = 1;
vector<int> v;
v.push_back(1);
for(int i = 2; i <= N; i++)
{
//check if it is adding a new color
cout << v.size() + 1;
for(int j = 0; j < v.size(); j++)
{
cout << " " << v[j];
}
cout << " " << i << endl;
int c;
cin >> c;
if(c > v.size())
{
v.push_back(i);
colors[i] = v.size();
}
else
{
int lower = 0;
int upper = v.size() - 1;
while(lower != upper)
{
int mid = (lower + upper) / 2;
cout << mid - lower + 2;
for(int j = lower; j <= mid; j++)
{
cout << " " << v[j];
}
cout << " " << i << endl;
int c;
cin >> c;
if(c > (mid - lower + 1))
{
lower = mid + 1;
}
else
{
upper = mid;
}
}
colors[i] = lower + 1;
}
}
cout << 0;
for(int i = 1; i <= N; i++)
{
cout << " " << colors[i];
}
return 0;
}
컴파일 시 표준 에러 (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... |