제출 #73002

#제출 시각아이디문제언어결과실행 시간메모리
73002KmcodeRoller Coaster Railroad (IOI16_railroad)C++14
0 / 100
132 ms7828 KiB
#include<bits/stdc++.h> using namespace std; //#include "railroad.h" vector<pair<int,int> > v; long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) { int n = (int) s.size(); for(int i=0;i<n;i++){ if(s[i]==t[i])continue; v.push_back(make_pair(s[i],1)); v.push_back(make_pair(t[i],0)); } sort(v.begin(),v.end()); reverse(v.begin(),v.end()); bool ok=false; int stk=0; int en=0; for(int i=0;i<v.size();i++){ if(v[i].second==1){ stk++; } else{ if(stk){ stk--; continue; } if(stk==0){ if(en==0){ en=1; break; } ok=true; break; } } } return 1; return ok; }

컴파일 시 표준 에러 (stderr) 메시지

railroad.cpp: In function 'long long int plan_roller_coaster(std::vector<int>, std::vector<int>)':
railroad.cpp:19:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i=0;i<v.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...