Submission #994517

#TimeUsernameProblemLanguageResultExecution timeMemory
994517SuPythonyRoller Coaster Railroad (IOI16_railroad)C++17
0 / 100
55 ms9536 KiB
#include <bits/stdc++.h> #include "railroad.h" using namespace std; typedef long long ll; bool comp(pair<int,int> a, pair<int,int> b) { if (a.first==b.first) return a.second<b.second; return a.first>b.first; } ll plan_roller_coaster(vector<int> s, vector<int> t) { vector<pair<int,int>> a; for (int i=0; i<s.size(); i++) { a.push_back({s[i],t[i]}); } sort(a.begin(),a.end(),comp); int curr=1; for (auto i: a) { if (curr>i.first) return 1; curr=i.second; } return 0; };

Compilation message (stderr)

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