제출 #1062893

#제출 시각아이디문제언어결과실행 시간메모리
1062893nvujicaRoller Coaster Railroad (IOI16_railroad)C++14
0 / 100
66 ms11028 KiB
#include <bits/stdc++.h> #include "railroad.h" #define fi first #define se second using namespace std; const int inf = 1e9; vector <pair<int, int> > v; long long plan_roller_coaster(vector<int> s, vector<int> t) { int n = s.size(); for(int i = 0; i < n; i++){ v.push_back({t[i], -1}); v.push_back({s[i], 1}); } v.push_back({1, -1}); v.push_back({inf, 1}); sort(v.begin(), v.end()); int sum = 0; for(int i = 0; i < v.size(); i++){ sum += v[i].se; if(sum > 0) return 0; } return 1; }

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

railroad.cpp: In function 'long long int plan_roller_coaster(std::vector<int>, std::vector<int>)':
railroad.cpp:27:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |     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...