Submission #137927

#TimeUsernameProblemLanguageResultExecution timeMemory
137927zoooma13Minerals (JOI19_minerals)C++14
25 / 100
282 ms262148 KiB
#include "bits/stdc++.h" #include "minerals.h" using namespace std; void go(vector<int> h1 ,vector<int> h2){ if(h1.size() == 1 && h2.size() == 1){ Answer(h1.front() ,h2.front()); return; } vector <int> nh1 = vector<int>{h1.begin() ,h1.begin()+h1.size()/2}; vector <int> nh2 = vector<int>{h1.begin()+h1.size()/2 ,h1.end()}; for(int i=0; i<nh1.size(); i++) Query(nh1[i]); vector <int> mh1 ,mh2; for(int i=0; i<h2.size(); i++){ if(Query(h2[i]) == nh1.size()) mh1.push_back(h2[i]); else mh2.push_back(h2[i]); Query(h2[i]); } for(int i=0; i<nh1.size(); i++) Query(nh1[i]); if(nh1.size()) go(nh1 ,mh1); if(nh2.size()) go(nh2 ,mh2); } void Solve(int N) { vector <int> h1(N); iota(h1.begin() ,h1.end() ,1); vector <int> h2(N); iota(h2.begin() ,h2.end() ,N+1); go(h1 ,h2); }

Compilation message (stderr)

minerals.cpp: In function 'void go(std::vector<int>, std::vector<int>)':
minerals.cpp:13:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0; i<nh1.size(); i++)
                  ~^~~~~~~~~~~
minerals.cpp:17:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0; i<h2.size(); i++){
                  ~^~~~~~~~~~
minerals.cpp:18:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if(Query(h2[i]) == nh1.size())
            ~~~~~~~~~~~~~^~~~~~~~~~~~~
minerals.cpp:25:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0; i<nh1.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...
#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...