Submission #923172

#TimeUsernameProblemLanguageResultExecution timeMemory
923172alexddSuper Dango Maker (JOI22_dango3)C++17
7 / 100
172 ms848 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; int n,m; vector<int> ord; void scoate_unu() { int ult=-1; vector<int> aux; for(int i=0;i<ord.size();i++) { aux.push_back(ord[i]); if(Query(aux)==1) { ult=i; break; } } aux.clear(); for(int i=ult;i>=0;i--) { vector<int> cv = aux; for(int j=i-1;j>=0;j--) cv.push_back(ord[j]); if((int)aux.size()+i+1==n || i==ult || Query(cv)==0) { aux.push_back(ord[i]); ord.erase(ord.begin()+i); } } ///scoate din ord Answer(aux); } void Solve(int N, int M) { n=N; m=M; for(int i=1;i<=n*m;i++) ord.push_back(i); random_shuffle(ord.begin(),ord.end()); for(int i=1;i<m;i++) { scoate_unu(); } Answer(ord); } /** 3 2 3 3 1 2 1 2 */

Compilation message (stderr)

dango3.cpp: In function 'void scoate_unu()':
dango3.cpp:10:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |     for(int i=0;i<ord.size();i++)
      |                 ~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...