# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
995908 | 2024-06-10T03:47:55 Z | fimh | 사육제 (CEOI14_carnival) | C++14 | 5 ms | 600 KB |
#include <bits/stdc++.h> using namespace std; using ll = long long; using pll = pair<ll, ll>; #define fi first #define int long long #define se second const ll N = 150 + 5; const ll blocksz = 320; const ll mod = 1e9 + 7; const ll inf = 1e18; ll n, rep; ll id[N]; void task(){ cin >> n; vector<ll> v; for (int i = 1; i <= n; ++i){ cout << i << " "; for (int j = 1; j <= i; ++j) cout << j << " "; cout << endl; cin >> rep; // cout << v.size() << " "; if (rep == v.size()){ // cout << "ddd"; int l = -1, r = v.size() - 1; while (l < r){ ll m = l + (r - l + 1) / 2; // cout << m << " "; cout << v.size() - m + 1<< " " << i << " "; for (int j = m; j < v.size(); ++j) cout << v[j] << " "; cout << endl; cin >> rep; if (rep < v.size() - m + 1) l = m; else r = m - 1; } id[i] = id[v[l]]; }else{ v.push_back(i); id[i] = v.size(); } } cout << 0 << " "; for (int i = 1; i <= n; ++i){ cout << id[i] << " "; } } signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll TC = 1; // cin >> TC; while (TC--) task(); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 344 KB | Output is correct |
2 | Correct | 3 ms | 344 KB | Output is correct |
3 | Correct | 2 ms | 344 KB | Output is correct |
4 | Correct | 1 ms | 460 KB | Output is correct |
5 | Correct | 3 ms | 344 KB | Output is correct |
6 | Correct | 2 ms | 344 KB | Output is correct |
7 | Correct | 3 ms | 344 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 344 KB | Output is correct |
2 | Correct | 4 ms | 344 KB | Output is correct |
3 | Correct | 3 ms | 600 KB | Output is correct |
4 | Correct | 2 ms | 344 KB | Output is correct |
5 | Correct | 3 ms | 344 KB | Output is correct |
6 | Correct | 3 ms | 344 KB | Output is correct |
7 | Correct | 3 ms | 344 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 344 KB | Output is correct |
2 | Correct | 2 ms | 344 KB | Output is correct |
3 | Correct | 4 ms | 344 KB | Output is correct |
4 | Correct | 2 ms | 344 KB | Output is correct |
5 | Correct | 3 ms | 344 KB | Output is correct |
6 | Correct | 3 ms | 344 KB | Output is correct |
7 | Correct | 4 ms | 344 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 344 KB | Output is correct |
2 | Correct | 3 ms | 344 KB | Output is correct |
3 | Correct | 2 ms | 344 KB | Output is correct |
4 | Correct | 1 ms | 344 KB | Output is correct |
5 | Correct | 4 ms | 344 KB | Output is correct |
6 | Correct | 3 ms | 344 KB | Output is correct |
7 | Correct | 4 ms | 344 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 344 KB | Output is correct |
2 | Correct | 4 ms | 344 KB | Output is correct |
3 | Correct | 3 ms | 344 KB | Output is correct |
4 | Correct | 3 ms | 344 KB | Output is correct |
5 | Correct | 3 ms | 600 KB | Output is correct |
6 | Correct | 3 ms | 460 KB | Output is correct |
7 | Correct | 2 ms | 344 KB | Output is correct |