Submission #1085533

#TimeUsernameProblemLanguageResultExecution timeMemory
1085533vako_pChameleon's Love (JOI20_chameleon)C++14
4 / 100
12 ms600 KiB
#include <bits/stdc++.h> #include "chameleon.h" using namespace std; #define ll int #define pb push_back ll n; vector<ll> v1,v2; vector<pair<ll,ll>> ans; void Solve(int N){ n = N; v1.pb(1); for(int i = 2; i <= 2 * n; i++){ v1.pb(i); if(Query(v1) != v1.size()){ ll l = 0, r = v1.size() - 1; while(r > l + 1){ v2.clear(); ll mid = l + (r - l) / 2; for(int j = mid; j < v1.size(); j++) v2.pb(v1[j]); if(Query(v2) != v2.size()) l = mid; else r = mid; } ans.pb({i, v1[l]}); v1.pop_back(); v1.erase(v1.begin() + l); } } // cout << ans.size() << endl; // for(auto it : ans) cout << it.first << ' ' << it.second << '\n'; for(auto it : ans) Answer(it.first, it.second); }

Compilation message (stderr)

chameleon.cpp: In function 'void Solve(int)':
chameleon.cpp:16:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |   if(Query(v1) != v1.size()){
      |      ~~~~~~~~~~^~~~~~~~~~~~
chameleon.cpp:21:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |     for(int j = mid; j < v1.size(); j++) v2.pb(v1[j]);
      |                      ~~^~~~~~~~~~~
chameleon.cpp:22:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |     if(Query(v2) != v2.size()) l = mid;
      |        ~~~~~~~~~~^~~~~~~~~~~~
#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...