제출 #403334

#제출 시각아이디문제언어결과실행 시간메모리
403334ja_kingyRoller Coaster Railroad (IOI16_railroad)C++14
0 / 100
101 ms7864 KiB
#include "railroad.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; ll INF = 2e9; long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) { int n = (int) s.size(); vector<pii> order; for (int i = 0; i < n; ++i) { order.push_back({t[i], -1}); order.push_back({s[i], 1}); } order.push_back({INF, 1}); order.push_back({1, -1}); sort(order.begin(), order.end()); reverse(order.begin(), order.end()); ll d = 0, ans = 0; for (pii p: order) { d += p.second; if (d < 0) ans = 1; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...