Problem - 1895D - Codeforces
Problem - 1895D - Codeforces
|
stdfloat | Logout
HOME TOP CATALOG CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP
Input
Language: GNU G++20 13.2 (64 bit, winlibs)
The first line contains one integer n (2 ≤ n ≤ 2 ⋅ 105 ).
Choose
Choose File No file chosen
The second line contains n − 1 integers a1 , a2 , … , an−1 (0 ≤ ai ≤ 2n). file:
Additional constraint on the input: it's always possible to construct at least one valid array b Submit
4
2 1 2
output Copy
0 2 3 1
input Copy
6
1 6 1 4 1
output Copy
2 3 5 4 0 1
Supported by
https://mirror.codeforces.com/problemset/problem/1895/D 1/1