Submission #1030960

#TimeUsernameProblemLanguageResultExecution timeMemory
1030960WarinchaiRoller Coaster Railroad (IOI16_railroad)C++14
0 / 100
70 ms13624 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<v.size()&&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();){
      |                 ~^~~~~~~~~
railroad.cpp:15:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |         while(i<v.size()&&v[i].first==sp){
      |               ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...