# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
113997 | 2019-05-29T13:40:28 Z | dndhk | 사육제 (CEOI14_carnival) | C++14 | 10 ms | 412 KB |
#include <bits/stdc++.h> #define pb push_back #define all(v) ((v).begin(), (v).end()) #define sortv(v) sort(all(v)) #define sz(v) ((int)(v).size()) #define uniqv(v) (v).erase(unique(all(v)), (v).end()) #define umax(a, b) (a)=max((a), (b)) #define umin(a, b) (a)=min((a), (b)) #define FOR(i,a,b) for(int i = (a); i <= (b); i++) #define rep(i,n) FOR(i,1,n) #define rep0(i,n) FOR(i,0,(int)(n)-1) #define FI first #define SE second #define INF 2000000000 #define INFLL 1000000000000000000LL using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAX_N = 150; int N; int c[MAX_N+1]; vector<int> v; int calc(int x, int y){ printf("%d ", x+2); for(int i=0; i<=x; i++){ printf("%d ", v[i]); } printf("%d\n", y); fflush(stdout); int t; scanf("%d", &t); return t; } int main(){ scanf("%d", &N); v.pb(1); c[1] = 1; for(int i=2; i<=N; i++){ v.pb(i); int t; printf("%d ", v.size()); for(int j=0; j<v.size(); j++){ printf("%d ", v[j]); } printf("\n"); fflush(stdout); scanf("%d", &t); if(t!=v.size()){ v.pop_back(); int s = 0, e = v.size()-1, m; while(s<e){ m = (s+e)/2; if(calc(m, i)==m+1){ e = m; }else{ s = m+1; } } c[i] = s+1; }else{ c[i] = v.size(); } } printf("0 "); for(int i=1; i<=N; i++){ printf("%d ", c[i]); } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 256 KB | Output is correct |
2 | Correct | 9 ms | 384 KB | Output is correct |
3 | Correct | 4 ms | 256 KB | Output is correct |
4 | Correct | 3 ms | 256 KB | Output is correct |
5 | Correct | 5 ms | 384 KB | Output is correct |
6 | Correct | 4 ms | 384 KB | Output is correct |
7 | Correct | 4 ms | 384 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 256 KB | Output is correct |
2 | Correct | 5 ms | 256 KB | Output is correct |
3 | Correct | 5 ms | 256 KB | Output is correct |
4 | Correct | 4 ms | 384 KB | Output is correct |
5 | Correct | 6 ms | 256 KB | Output is correct |
6 | Correct | 8 ms | 256 KB | Output is correct |
7 | Correct | 7 ms | 384 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 384 KB | Output is correct |
2 | Correct | 7 ms | 384 KB | Output is correct |
3 | Correct | 5 ms | 256 KB | Output is correct |
4 | Correct | 5 ms | 384 KB | Output is correct |
5 | Correct | 8 ms | 384 KB | Output is correct |
6 | Correct | 6 ms | 384 KB | Output is correct |
7 | Correct | 10 ms | 384 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 384 KB | Output is correct |
2 | Correct | 8 ms | 256 KB | Output is correct |
3 | Correct | 7 ms | 384 KB | Output is correct |
4 | Correct | 6 ms | 256 KB | Output is correct |
5 | Correct | 6 ms | 256 KB | Output is correct |
6 | Correct | 8 ms | 384 KB | Output is correct |
7 | Correct | 5 ms | 256 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 256 KB | Output is correct |
2 | Correct | 6 ms | 384 KB | Output is correct |
3 | Correct | 5 ms | 412 KB | Output is correct |
4 | Correct | 8 ms | 256 KB | Output is correct |
5 | Correct | 4 ms | 384 KB | Output is correct |
6 | Correct | 4 ms | 256 KB | Output is correct |
7 | Correct | 4 ms | 384 KB | Output is correct |