Submission #998429

#TimeUsernameProblemLanguageResultExecution timeMemory
998429efishelSuper Dango Maker (JOI22_dango3)C++17
22 / 100
251 ms604 KiB
//Logan/Dango #include "dango3.h" #include <bits/stdc++.h> using namespace std; void Solve(int N, int M){ srand(94894571); int used[N*M+1],dis=N*M; vector<int>r,rs[M]; for(int i=1;i<=N*M;i++)used[i]=0; for(int i=1;i<=M;i++){ while(r.size()<N||!Query(r)){ int j=1,k=rand()%dis; while(true){ if(used[j])j++; else if(k)j++,k--; else break; } r.push_back(j); used[j]=1,dis--; } while(N<r.size()){ int t=r[0]; r.erase(r.begin()); if(!Query(r))r.push_back(t); else used[t]=0,dis++; } Answer(r); r.clear(); } }

Compilation message (stderr)

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:12:23: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   12 |         while(r.size()<N||!Query(r)){
      |               ~~~~~~~~^~
dango3.cpp:22:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |         while(N<r.size()){
      |               ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...