# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
795150 | fatemetmhr | Roller Coaster Railroad (IOI16_railroad) | C++17 | 117 ms | 12140 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// ~ Be Name Khoda ~ //
#include "railroad.h"
#include <bits/stdc++.h>
//#pragma GCC optimize ("O3")
//#pragma GCC target("avx2")
//#pragma GCC optimize("unroll-loops,Ofast")
using namespace std;
typedef long long ll;
#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define fi first
#define se second
const int maxn = 1e6 + 10;
const int maxn5 = 5e5 + 10;
const int maxnt = 1.2e6 + 10;
const int maxn3 = 1e3 + 10;
const int mod = 1e9 + 7;
const ll inf = 1e18;
vector <int> num;
int cnt[maxn5], av[maxn5];
long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) {
int n = s.size();
for(int i = 0; i < n; i++){
num.pb(s[i]);
num.pb(t[i]);
}
num.pb(0);
num.pb(mod);
sort(all(num));
num.resize(unique(all(num)) - num.begin());
for(int i = 0; i < n; i++) if(s[i] != t[i]){
s[i] = lower_bound(all(num), s[i]) - num.begin();
t[i] = lower_bound(all(num), t[i]) - num.begin();
if(s[i] > t[i]){
cnt[t[i]]--;
cnt[s[i] + 1]++;
av[t[i]]++;
av[s[i] + 1]--;
}
else{
cnt[s[i]]++;
cnt[t[i] + 1]--;
av[s[i]]++;
av[t[i] + 1]--;
}
}
cnt[0]--;
av[0]++;
int cur = 0, a = 0;
bool re = false;
for(int i = 0; i < num.size(); i++){
cur += cnt[i];
a += av[i];
if(cur > 0)
return 1;
if(a && re)
return 1;
if(a == 0)
re = true;
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |