Submission #575025

#TimeUsernameProblemLanguageResultExecution timeMemory
575025birthdaycakeCarnival (CEOI14_carnival)C++17
100 / 100
24 ms4956 KiB
#include<bits/stdc++.h> #define int long long #define mod 1000000007 using namespace std; vector<int>adj[200001]; int vs[151],fin[151]; signed main(){ int n; cin >> n; vs[1] = 1; int c = 2, prv = 1; for(int i = 2; i <= n; i++){ cout << i << ' '; for(int j = 1; j <= i; j++){ cout << j << ' '; } cout << endl; int ans; cin >> ans; if(ans > prv) vs[i] = c++; prv = ans; } for(int i = 1; i <= n; i++) fin[i] = vs[i]; for(int i = 2; i <= n; i++){ if(fin[i] == 0){ for(int j = 1; j <= n; j++){ if(vs[j]){ cout << 2 << ' ' << i << ' ' << j << endl; int ans; cin >> ans; if(ans == 1){ fin[i] = vs[j]; break; } } } } } cout << 0 << ' ' ; for(int i = 1; i <= n;i++){ cout << fin[i] << ' '; } cout << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...