Submission #799640

#TimeUsernameProblemLanguageResultExecution timeMemory
799640KhizriRoller Coaster Railroad (IOI16_railroad)C++17
0 / 100
147 ms18212 KiB
#include "railroad.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define F first #define S second #define INF 1e18 #define all(v) (v).begin(),(v).end() #define rall(v) (v).rbegin(),(v).rend() #define pii pair<int,int> #define pll pair<ll,ll> #define OK cout<<"Ok"<<endl; #define MOD (ll)(1e9+7) bool cmp(pii a,pii b){ if(a.S==b.S) return a.F<b.F; return a.S<b.S; } long long plan_roller_coaster(vector<int> s, vector<int> t) { int n = (int) s.size(); vector<pii>vt; multiset<int>st; for(int i=0;i<n;i++){ vt.pb({s[i],t[i]}); st.insert(s[i]); } sort(all(vt),cmp); for(int i=0;i<vt.size()-1;i++){ st.erase(st.find(vt[i].F)); if(*st.begin()<vt[i].S&&vt[i+1].S>vt[i].S){ 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:28: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]
   28 |     for(int i=0;i<vt.size()-1;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...