Submission #423820

#TimeUsernameProblemLanguageResultExecution timeMemory
423820kai824Chameleon's Love (JOI20_chameleon)C++17
4 / 100
10 ms304 KiB
#include "chameleon.h" #include <bits/stdc++.h> using namespace std; namespace{ vector<int> v; } void search(){ int x=v.back();v.pop_back(); vector<int> tmp; int lo=0,hi=v.size()-1,mid; while(lo<hi){ mid=lo+((hi-lo)/2); tmp.clear(); tmp.push_back(x); for(int i=lo;i<=mid;i++)tmp.push_back(v[i]); if(Query(tmp)<tmp.size())hi=mid; else lo=mid+1; } //cout<<v[lo]<<' '<<x<<'\n'; Answer(v[lo],x); v.erase(v.begin()+lo); } void Solve(int n) { v.push_back(1); for(int i=2;i<=2*n;i++){ v.push_back(i); if(v.size()==1)continue; if(Query(v)<v.size()){//lermao... search(); } } //Answer(i * 2 + 1, i * 2 + 2); }

Compilation message (stderr)

chameleon.cpp: In function 'void search()':
chameleon.cpp:18:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |     if(Query(tmp)<tmp.size())hi=mid;
      |        ~~~~~~~~~~^~~~~~~~~~~
chameleon.cpp: In function 'void Solve(int)':
chameleon.cpp:31:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |     if(Query(v)<v.size()){//lermao...
      |        ~~~~~~~~^~~~~~~~~
#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...