제출 #476289

#제출 시각아이디문제언어결과실행 시간메모리
476289ShahdMohamed사육제 (CEOI14_carnival)C++17
0 / 100
66 ms200 KiB
///LW M4 ACC HAZ3L GAMED ///YARAB WALA...I MEAN YARAB ACC #include<bits/stdc++.h> #define ll long long //#define endl "\n" const ll mod = (ll) 1e9 + 7; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ll n,cnt,took=0,p=1; cin>>n; vector<ll>ans(n); cout<<n<<" "; for (ll i=1; i<=n; i++) cout<<i<<" "; cout<<endl; cin>>cnt; for (ll i=0; i<n; i++) { if (n-took==cnt) { for (ll j=0; j<n; j++) { if (ans[j]==0) { ans[j]=p; p++; } } break; } if (ans[i]==0) { ans[i]=p; took++; for (ll j=i+1; j<n; j++) { if (n-took==cnt) { for (ll j=0; j<n; j++) { if (ans[j]==0) { ans[j]=p; p++; } } break; } if (ans[j]==0) { cout<<"2 "<<i+1<<" "<<j+1<<endl; ll x; cin>>x; if (x==1) { ans[j]=p; took++; } } } p++; cnt--; } if (n-took==cnt) { for (ll j=0; j<n; j++) { if (ans[j]==0) { ans[j]=p; p++; } } break; } } cout<<"0 "; for (auto i:ans) cout<<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...