제출 #123607

#제출 시각아이디문제언어결과실행 시간메모리
123607baqargamRoller Coaster Railroad (IOI16_railroad)C++14
0 / 100
123 ms7684 KiB
#include "bits/stdc++.h" #include "railroad.h" using namespace std; long long j,l,d[400005],g[100],bal; vector<pair<int,int> >v; long long plan_roller_coaster(vector<int> s, vector<int> t) { int n = (int) s.size(); for(int i=1;i<=n;i++){ v.push_back({s[i-1],i}); v.push_back({t[i-1],-i}); } v.push_back({1000000001,n+1}); v.push_back({1,-n-1}); sort(v.begin(),v.end()); for(int i=0;i<v.size();i++){ int id=v[i].second; int val=v[i].first; if(id<0) bal--; else bal++; if(v[i].first<v[v.size()-1].first && v[i].first!=v[i+1].first) if(bal>0) return 0; } return 1; }

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

railroad.cpp: In function 'long long int plan_roller_coaster(std::vector<int>, std::vector<int>)':
railroad.cpp:18:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<v.size();i++){
                 ~^~~~~~~~~
railroad.cpp:20:13: warning: unused variable 'val' [-Wunused-variable]
         int val=v[i].first;
             ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...