Submission #1030955

#TimeUsernameProblemLanguageResultExecution timeMemory
1030955WarinchaiRoller Coaster Railroad (IOI16_railroad)C++14
0 / 100
2033 ms8528 KiB
#include "railroad.h" #include<bits/stdc++.h> using namespace std; long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) { int n = (int) s.size(); vector<pair<int,int>>v; for(int i=0;i<n;i++){ v.push_back({s[i],1}); v.push_back({t[i],-1}); } sort(v.begin(),v.end()); int val=0; for(int i=0;i<v.size();){ int sp=v[i].first; while(i<n&&v[i].first==sp){ val+=v[i].second; i++; } if(val>1)return 1; } return 0; }

Compilation message (stderr)

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