Submission #995881

#TimeUsernameProblemLanguageResultExecution timeMemory
995881anHiepCarnival (CEOI14_carnival)C++14
0 / 100
9 ms344 KiB
#pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define vec vector<long long> #define pb push_back #define sz(a) a.size() #define fi first #define se second #define ret(a) return cout<<(a)<<"\n",void() // #define endl "\n" #define el cout<<"\n" #define f(a) for(int i=0;i<(a);i++) #define f1(a) for(int i=1;i<(a);i++) #define all(v) v.begin(),v.end() template<class T> void PRINTARR(T a[], int n){for(int i=0;i<n;i++){std::cout<<a[i]<<" ";}std::cout<<'\n';} template<class T> void PRINTVEC(std::vector<T> arr){for(int i=0;i<arr.size();i++){std::cout<<arr[i]<<" ";}std::cout << '\n';} int tc=1; void input(){ // cin>>tc; } const ll oo = 1e18; const int maxn = 160; const int MOD = 1e9+7; const int S = 360; #define BASE 37 #define SMOD 998244353 //REMEMBER: //USE LONG LONG WHEN NECESSARY //ALWAYS USE "\n" OR el; //PRAGMA? int n; int ans[maxn]; bool check(int i , int mid){ if(i==mid) return 1; int cnt1, cnt2; cout<<mid - i + 1 << " "; for(int j = i; j<=mid;j++) cout<<j<<" "; cout<<endl; cin>>cnt1; cout<<mid - (i+1) + 1<<" "; for(int j = i+1;j<=mid;j++) cout<<j<<" "; cout<<endl; cin>>cnt2; if(cnt1==cnt2) return 1; return 0; } void solve() { cin >> n; for(int i = 1; i <= n; i++){ ans[i] = i; } for(int i = 1; i <=n;i++){ int l = i, r = n + 1; while(r-l>1){ int mid = (l + r)/2; if(check(i, mid)) r = mid; else l = mid; } ans[r] = ans[i]; } cout<<"0 "; for(int i = 1;i<=n;i++){ cout<<ans[i]<<" "; } cout<<endl; } int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); // init(); input(); while (tc--) solve(); cerr << "\nTime elapsed: " << 1000.0 * clock() / CLOCKS_PER_SEC << " ms.\n"; 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...