제출 #880954

#제출 시각아이디문제언어결과실행 시간메모리
880954HuyQuang_re_ZeroRoller Coaster Railroad (IOI16_railroad)C++14
0 / 100
627 ms59732 KiB
#include <bits/stdc++.h> #define ll long long #define db long double #define II pair <ll,ll> #define III pair <ll,II> #define IV pair <vector <int>,vector <int> > #define IDB pair <db,int> #define TII pair <treap*,treap*> #define fst first #define snd second #define BIT(x,i) ((x>>i)&1) #define pi acos(-1) #define to_radian(x) (x*pi/180.0) #define to_degree(x) (x*180.0/pi) #define Log(x) (31-__builtin_clz((int)x)) #define LogLL(x) (63-__builtin_clzll((ll)x)) using namespace std; #include "railroad.h" ll plan_roller_coaster(vector <int> s,vector <int> t) { set <int> val; map <int,int> U,D; int i; for(i=0;i<s.size();i++) { val.insert(s[i]); val.insert(t[i]); if(s[i]<=t[i]) U[s[i]]++,U[t[i]]--; else D[t[i]]++,D[s[i]]--; } val.insert(1); D[1]++; int up=0,down=0; for(int x:val) { up+=U[x]; down+=D[x]; if(up>down) return 1; } return 0; } /* int main() { freopen("railroad.inp","r",stdin); freopen("railroad.out","w",stdout); vector <int> s,t; int l,r; while(cin>>l>>r) s.push_back(l),t.push_back(r); cout<<plan_roller_coaster(s,t); } */

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

railroad.cpp: In function 'long long int plan_roller_coaster(std::vector<int>, std::vector<int>)':
railroad.cpp:24:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |     for(i=0;i<s.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...