Submission #918511

#TimeUsernameProblemLanguageResultExecution timeMemory
918511AiperiiiCarnival (CEOI14_carnival)C++14
100 / 100
6 ms848 KiB
#include <bits/stdc++.h> #define int long long #define ff first #define ss second #define pb push_back #define all(x) x.begin(),x.end() using namespace std; signed main(){ ios_base::sync_with_stdio(); cin.tie(0);cout.tie(0); int n;cin>>n; vector <int> vis(n+1); vector <int> uniq,v,p; for(int i=1;i<=n;i++){ v.pb(i); cout<<v.size()<<" "; for(auto x : v)cout<<x<<" "; cout<<endl; int dt;cin>>dt; if(p.size()==0 or dt>p.back()){ uniq.pb(i); vis[i]=uniq.size(); } p.pb(dt); } for(int i=1;i<=n;i++){ if(vis[i])continue; int l=0,r=uniq.size(); while(l+1<r){ int md=(l+r)/2; vector <int> v; v.pb(i); for(int j=md;j<uniq.size();j++){ v.pb(uniq[j]); } cout<<v.size()<<" "; for(auto x : v)cout<<x<<" "; cout<<endl; int dt;cin>>dt; if(dt==uniq.size()-md+1)r=md; else l=md; } vis[i]=vis[uniq[l]]; } for(int i=0;i<=n;i++)cout<<vis[i]<<" "; }

Compilation message (stderr)

carnival.cpp: In function 'int main()':
carnival.cpp:33:24: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |          for(int j=md;j<uniq.size();j++){
      |                       ~^~~~~~~~~~~~
carnival.cpp:40:15: warning: comparison of integer expressions of different signedness: 'long long int' and 'long long unsigned int' [-Wsign-compare]
   40 |          if(dt==uniq.size()-md+1)r=md;
      |             ~~^~~~~~~~~~~~~~~~~~
#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...