Submission #994852

#TimeUsernameProblemLanguageResultExecution timeMemory
994852SuPythonyRoller Coaster Railroad (IOI16_railroad)C++17
0 / 100
105 ms16724 KiB
#include <bits/stdc++.h> #include "railroad.h" using namespace std; typedef long long ll; ll plan_roller_coaster(vector<int> s, vector<int> t) { int curr=1; multiset<pair<int,int>> a; for (int i=0; i<s.size(); i++) { a.insert({s[i],t[i]}); } while (!a.empty()) { auto it=a.lower_bound({curr,0}); if (it==a.end()) return 1; curr=(*it).second; a.erase(it); } return 0; };

Compilation message (stderr)

railroad.cpp: In function 'll plan_roller_coaster(std::vector<int>, std::vector<int>)':
railroad.cpp:9:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |     for (int i=0; i<s.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...