Submission #1005704

#TimeUsernameProblemLanguageResultExecution timeMemory
1005704enzySuper Dango Maker (JOI22_dango3)C++17
100 / 100
1522 ms912 KiB
#include "dango3.h" #include<bits/stdc++.h> using namespace std; void Solve(int n, int m) { /*std::vector<int> x(3); x[0] = 1; x[1] = 2; x[2] = 3; variable_example = Query(x); for (int i = 0; i < M; i++) { vector<int> a(N); for (int j = 0; j < N; j++) { a[j] = N * i + j + 1; } Answer(a); }*/ vector<int>v[m+1]; for(int i=1;i<=n*m;i++){ int l=1, r=m; while(l<r){ int mid=(l+r)/2; vector<int>q; for(int j=i+1;j<=n*m;j++) q.push_back(j); for(int j=mid+1;j<=m;j++) for(int k=0;k<v[j].size();k++) q.push_back(v[j][k]); int check=Query(q); if(check>=m-mid) r=mid; else l=mid+1; } v[l].push_back(i); } for(int i=1;i<=m;i++) Answer(v[i]); }

Compilation message (stderr)

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:26:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |                 for(int k=0;k<v[j].size();k++) q.push_back(v[j][k]);
      |                             ~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...