Submission #836064

#TimeUsernameProblemLanguageResultExecution timeMemory
836064LiudasMinerals (JOI19_minerals)C++17
40 / 100
20 ms3036 KiB
#include "minerals.h" #include "minerals.h" #include <cstdio> #include <cstdlib> #include <algorithm> #include <vector> #include <iostream> using namespace std; void div(vector<int> start, vector<int> end){ int N = start.size(); vector<int> l, r, le, re; //cout << start.size() << " " << end.size() << endl; if(start.size() == 1){ Answer(start[0], end[0]); return; } for(int i = 0; i < N/2; i ++){ Query(start[i]); l.push_back(start[i]); } for(int i = N/2; i < N; i ++){ r.push_back(start[i]); } for(int i = 0; i < N; i ++){ if(Query(end[i]) == l.size()){ le.push_back(end[i]); } else{ re.push_back(end[i]); } Query(end[i]); } for(int i : l){ Query(i); } div(l, le); div(r, re); } void Solve(int N) { vector<int> start, end; for(int i = 0; i < N * 2; i ++){ int t = start.size(); int ans = Query(i+1); if(ans == t + 1){ start.push_back(i+1); } else{ end.push_back(i+1); Query(i+1); } } for(int i : start)Query(i); div(start, end); }

Compilation message (stderr)

minerals.cpp: In function 'void div(std::vector<int>, std::vector<int>)':
minerals.cpp:25:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |     if(Query(end[i]) == l.size()){
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~
#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...