# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
533262 | 2022-03-05T08:10:03 Z | christinelynn | 사육제 (CEOI14_carnival) | C++17 | 10 ms | 292 KB |
#include<bits/stdc++.h> #define pb push_back using namespace std; int main(){ int n; cin >> n; vector<int> sim; vector<int> belum; int warna[155]; for(int i = 1; i <= n; i++){ cout << sim.size() + 1; for(int j = 0; j < sim.size(); j++){ cout << " " << sim[j]; } cout << " " << i; cout << endl; int jawab; cin >> jawab; if(jawab == sim.size() + 1){ sim.pb(i); }else{ belum.pb(i); } } for(int i = 0; i < sim.size(); i++){ warna[sim[i]] = i + 1; } for(int i = 0; i < belum.size(); i++){ int now = belum[i]; int l = 0, r = sim.size(); int ans = -1; while(l <= r){ int mid = (l + r)/2; cout << mid + 2; cout << " " << now; for(int j = 0; j <= mid; j++){ cout << " " << sim[j]; } cout << endl; int idx = mid + 1; int jawab; cin >> jawab; if(jawab == idx){ ans = mid; r = mid - 1; }else{ l = mid + 1; } } warna[now] = ans + 1; } cout << "0"; for(int i = 1; i <= n; i++){ cout << " " << warna[i]; } cout << endl; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 200 KB | Output is correct |
2 | Correct | 7 ms | 200 KB | Output is correct |
3 | Correct | 5 ms | 200 KB | Output is correct |
4 | Correct | 5 ms | 200 KB | Output is correct |
5 | Correct | 4 ms | 200 KB | Output is correct |
6 | Correct | 5 ms | 292 KB | Output is correct |
7 | Correct | 8 ms | 200 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 200 KB | Output is correct |
2 | Correct | 8 ms | 200 KB | Output is correct |
3 | Correct | 5 ms | 200 KB | Output is correct |
4 | Correct | 2 ms | 200 KB | Output is correct |
5 | Correct | 8 ms | 200 KB | Output is correct |
6 | Correct | 7 ms | 200 KB | Output is correct |
7 | Correct | 6 ms | 256 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 200 KB | Output is correct |
2 | Correct | 6 ms | 200 KB | Output is correct |
3 | Correct | 7 ms | 200 KB | Output is correct |
4 | Correct | 3 ms | 200 KB | Output is correct |
5 | Correct | 8 ms | 200 KB | Output is correct |
6 | Correct | 8 ms | 200 KB | Output is correct |
7 | Correct | 6 ms | 200 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 200 KB | Output is correct |
2 | Correct | 7 ms | 288 KB | Output is correct |
3 | Correct | 4 ms | 200 KB | Output is correct |
4 | Correct | 4 ms | 200 KB | Output is correct |
5 | Correct | 10 ms | 200 KB | Output is correct |
6 | Correct | 6 ms | 200 KB | Output is correct |
7 | Correct | 9 ms | 200 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 288 KB | Output is correct |
2 | Correct | 7 ms | 200 KB | Output is correct |
3 | Correct | 7 ms | 200 KB | Output is correct |
4 | Correct | 7 ms | 200 KB | Output is correct |
5 | Correct | 7 ms | 200 KB | Output is correct |
6 | Correct | 5 ms | 200 KB | Output is correct |
7 | Correct | 3 ms | 200 KB | Output is correct |