# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
376208 | daniel920712 | Bitaro, who Leaps through Time (JOI19_timeleap) | C++14 | 112 ms | 24584 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
using namespace std;
vector < pair < long long , long long > > Next[300005];
pair < long long , long long > how[300005];
long long F(long long here,long long fa,long long fin,long long x,long long y,long long z)
{
if(here==fin)
{
printf("%lld\n",y+max((long long) 0,x-z));
}
else
{
for(auto i:Next[here])
{
if(i.first==fa) continue;
if(x>=how[i.second].second) F(i.first,here,fin,how[i.second].second,y+x-how[i.second].second+1,z);
else if(x<=how[i.second].first) F(i.first,here,fin,how[i.second].first+1,y,z);
else F(i.first,here,fin,x+1,y,z);
}
}
}
int main()
{
long long N,M,a,b,c,d,i;
scanf("%lld %lld",&N,&M);
for(i=1;i<N;i++)
{
scanf("%lld %lld",&c,&d);
Next[i].push_back(make_pair(i+1,i));
Next[i+1].push_back(make_pair(i,i));
how[i]=make_pair(c,d);
}
/*while(M--)
{
scanf("%lld",&a);
if(a==1)
{
scanf("%lld %lld %lld",&b,&c,&d);
how[b]=make_pair(c,d);
}
else
{
scanf("%lld %lld %lld %lld",&a,&b,&c,&d);
F(a,-1,c,b,0,d);
}
}*/
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... |