Submission #418299

#TimeUsernameProblemLanguageResultExecution timeMemory
418299FlippenFazHighway Tolls (IOI18_highway)C++11
0 / 100
14 ms456 KiB
#include "highway.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; set<int> curCities; void find_pair(int N, vector<int> U, vector<int> V, int A, int B) { vector<int> askArr; askArr.resize(U.size()); ll sml = ask(askArr); askArr[0] = 1; ll cur = ask(askArr); if (cur > sml) { curCities.insert(U[0]); curCities.insert(V[0]); } for (int i = 1; i < askArr.size(); i++) { U[i-1] = 0; U[i] = 1; ll cur = ask(askArr); if (cur > sml) { if (curCities.erase(U[i]) == 0) { curCities.insert(U[i]); } if (curCities.erase(V[i]) == 0) { curCities.insert(V[i]); } } } vector<int> cits; for (auto it = curCities.begin(); it != curCities.end(); it++) { cits.push_back(*it); } answer(cits[0], cits[1]); }

Compilation message (stderr)

highway.cpp: In function 'void find_pair(int, std::vector<int>, std::vector<int>, int, int)':
highway.cpp:19:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |     for (int i = 1; i < askArr.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...