# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
506109 | ryangohca | Bitaro, who Leaps through Time (JOI19_timeleap) | C++17 | 744 ms | 91032 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define pii pair<int, int>
#define ti3 tuple<int, int, int>
#define ti4 tuple<int, int, int, int>
#define int long long
// lalalalalalala, you flood into me, slowly from over the horizon ~ Seunghee, The Fifth Season (SSFWL)
using namespace std;
struct dat{
int lTime, rTime, timeUsed, powers;
dat(): lTime(0), rTime(0), timeUsed(0), powers(0){}
dat(int a, int b, int c, int d): lTime(a), rTime(b), timeUsed(c), powers(d){}
dat operator +(const dat &oth){
dat ans;
ans.timeUsed = timeUsed + oth.timeUsed;
ans.powers = powers + oth.powers;
int lrch = lTime + timeUsed, rrch = rTime + timeUsed;
if (max(lrch, oth.lTime) <= min(rrch, oth.rTime)){
// in some interval on left node, we can reach the right node on time.
ans.lTime = max(lrch, oth.lTime) - timeUsed;
ans.rTime = min(rrch, oth.rTime) - timeUsed;
} else if (oth.lTime > rrch){
// right node opens too late, need to wait
// better for interval to start as late as possible, bcos waiting better than using powers
ans.lTime = rTime;
ans.rTime = rTime;
ans.timeUsed += oth.lTime - rrch;
} else {
// right node closes too early, need to use powers
// better for interval to start as early as possible to use less powers
ans.powers += lrch - oth.rTime;
컴파일 시 표준 에러 (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... |