Submission #556833

#TimeUsernameProblemLanguageResultExecution timeMemory
556833hibikiCarnival (CEOI14_carnival)C++11
0 / 100
1 ms288 KiB
#include<bits/stdc++.h> using namespace std; #define PB push_back int n,ty[160],cur_ty=1; int main() { ty[1]=cur_ty++; scanf("%d",&n); for(int i=2;i<=n;i++) { int l=1,r=i-1,nw_ty=-1; while(l<=r) { printf("%d %d\n",l,r); int mid=(l+r)>>1; set<int> s; vector<int> ask; for(int j=mid;j<i;j++) { s.insert(ty[j]); ask.PB(j); } ask.PB(i); printf("%d ",ask.size()); for(auto val:ask) printf("%d ",val); printf("\n"); fflush(stdout); int ret; scanf("%d",&ret); if(ret>s.size()) r=mid-1; else nw_ty=ty[mid],l=mid+1; } if(nw_ty==-1) ty[i]=cur_ty++; else ty[i]=nw_ty; } printf("0 "); for(int i=1;i<=n;i++) printf("%d ",ty[i]); printf("\n"); fflush(stdout); return 0; }

Compilation message (stderr)

carnival.cpp: In function 'int main()':
carnival.cpp:31:22: warning: format '%d' expects argument of type 'int', but argument 2 has type 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wformat=]
   31 |             printf("%d ",ask.size());
      |                     ~^   ~~~~~~~~~~
      |                      |           |
      |                      int         std::vector<int>::size_type {aka long unsigned int}
      |                     %ld
carnival.cpp:39:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::set<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   39 |             if(ret>s.size())
      |                ~~~^~~~~~~~~
carnival.cpp:12:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
carnival.cpp:38:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   38 |             scanf("%d",&ret);
      |             ~~~~~^~~~~~~~~~~
#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...