Submission #546155

#TimeUsernameProblemLanguageResultExecution timeMemory
546155luka1234Super Dango Maker (JOI22_dango3)C++17
100 / 100
4005 ms776 KiB
#include "dango3.h" #include <vector> #include<bits/stdc++.h> using namespace std; namespace { vector<int> ans[26]; } bool check(int n,int m,vector<int> vec,int f){ if(vec.size()==0) return 0; if(vec.size()==n) return 1; vec.push_back(f); vector<int> v; int ind=0; for(int k=1;k<=n*m;k++){ if(ind<vec.size()&&vec[ind]==k){ ind++; } else{ v.push_back(k); } } int x=Query(v); if(x<=m-2) return 1; else return 0; } void Solve(int N, int M){ int l=1,r=M,md; bool bl; for(int k=1;k<=N*M;k++){ l=1; r=M; while(l<r){ md=(l+r)/2; bl=check(N,M,ans[md],k); if(bl==0) r=md; else l=md+1; } ans[l].push_back(k); } for(int k=1;k<=M;k++){ Answer(ans[k]); } }

Compilation message (stderr)

dango3.cpp: In function 'bool check(int, int, std::vector<int>, int)':
dango3.cpp:11:15: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   11 |  if(vec.size()==n)
      |     ~~~~~~~~~~^~~
dango3.cpp:17:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |   if(ind<vec.size()&&vec[ind]==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...