제출 #799638

#제출 시각아이디문제언어결과실행 시간메모리
799638KhizriRoller Coaster Railroad (IOI16_railroad)C++17
0 / 100
108 ms14364 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(s[i])); if(*st.begin()<t[i]&&vt[i+1].S>t[i]){ return 1; } } return 0; }

컴파일 시 표준 에러 (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...