#599
Range Reconstruction
시간 제한
2s
메모리 제한
1024MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%
문제
Bessie has an array , where and for all . She won't tell you itself, but she will tell you the range of each subarray of . That is, for each pair of indices , Bessie tells you . Given these values of , please construct an array that could have been Bessie's original array. The values in your array should be in the range .
입력
The first line contains .
Another lines follow. The th of these lines contains the integers .
It is guaranteed that there is some array with values in the range such that for all , .
출력
Output one line containing integers in the range representing your array. They must satisfy for all .
예제 입력 1
3
0 2 2
0 1
0
예제 출력 1
1 3 2
예제 입력 2
3
0 1 1
0 0
0
예제 출력 2
0 1 1
예제 입력 3
4
0 1 2 2
0 1 1
0 1
0
예제 출력 3
1 2 3 2
예제 입력 4
4
0 1 1 2
0 0 2
0 2
0
예제 출력 4
1 2 2 0
점수
Test 5 satisfies .Tests 6-8 satisfy for all . Tests 9-14 satisfy no additional constraints.
코드 제출
코드를 제출하려면 로그인이 필요합니다.
로그인내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.