# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
918367 | 2024-01-29T17:56:33 Z | Ferid20072020 | 사육제 (CEOI14_carnival) | C++14 | 7 ms | 688 KB |
#include <bits/stdc++.h> #define int long long using namespace std; int n , ans; signed main(){ cin >> n; cout << "1 1"; cout << endl; cin >> ans; vector<int> arr(n+5); arr[1] = 1; int color = 2; for(int i=2 ; i<=n ; i++){ set<int> cnt; cout << i << " "; for(int j=1 ; j<=i ; j++){ cout << j << " "; } for(int j=1 ; j<i ; j++){ cnt.insert(arr[j]); } cout << endl; cin >> ans; if(ans > cnt.size()){ arr[i] = color; color++; cnt.clear(); } else{ int l = 1 , r = i-1; while(l < r){ cnt.clear(); int mid = (l + r) / 2; cout << mid - l + 2 << " "; for(int k=l ; k<=mid ; k++){ cout << k << " "; cnt.insert(arr[k]); } cout << i; cout << endl; cin >> ans; if(ans > cnt.size()){ l = mid + 1; } else{ r = mid; } } arr[i] = arr[l]; cnt.clear(); } } cout << 0 << " "; for(int i=1 ; i<=n ; i++){ cout << arr[i] << " "; } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 344 KB | Output is correct |
2 | Correct | 4 ms | 432 KB | Output is correct |
3 | Correct | 3 ms | 440 KB | Output is correct |
4 | Correct | 2 ms | 688 KB | Output is correct |
5 | Correct | 5 ms | 344 KB | Output is correct |
6 | Correct | 7 ms | 500 KB | Output is correct |
7 | Correct | 5 ms | 436 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 340 KB | Output is correct |
2 | Correct | 5 ms | 436 KB | Output is correct |
3 | Correct | 2 ms | 432 KB | Output is correct |
4 | Correct | 2 ms | 436 KB | Output is correct |
5 | Correct | 5 ms | 344 KB | Output is correct |
6 | Correct | 6 ms | 344 KB | Output is correct |
7 | Correct | 5 ms | 344 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 344 KB | Output is correct |
2 | Correct | 6 ms | 344 KB | Output is correct |
3 | Correct | 4 ms | 436 KB | Output is correct |
4 | Correct | 2 ms | 688 KB | Output is correct |
5 | Correct | 4 ms | 436 KB | Output is correct |
6 | Correct | 6 ms | 432 KB | Output is correct |
7 | Correct | 5 ms | 432 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 344 KB | Output is correct |
2 | Correct | 5 ms | 344 KB | Output is correct |
3 | Correct | 3 ms | 688 KB | Output is correct |
4 | Correct | 2 ms | 432 KB | Output is correct |
5 | Correct | 5 ms | 436 KB | Output is correct |
6 | Correct | 4 ms | 432 KB | Output is correct |
7 | Correct | 5 ms | 432 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 344 KB | Output is correct |
2 | Correct | 5 ms | 344 KB | Output is correct |
3 | Correct | 4 ms | 436 KB | Output is correct |
4 | Correct | 3 ms | 432 KB | Output is correct |
5 | Correct | 4 ms | 432 KB | Output is correct |
6 | Correct | 3 ms | 688 KB | Output is correct |
7 | Correct | 2 ms | 428 KB | Output is correct |