Yasya and the Mysterious Tree
1980G2300· international master2.5s512 MB⌨ stdin/stdout
Examples
Sample 1of 2multi-test • hover to link
Input
23 71 2 13 1 8^ 5? 2 9^ 1? 1 10^ 6? 3 1? 2 95 61 2 7773 2 28124 1 165 3 1000000000^ 4? 3 123? 5 1000000000^ 1000000000? 1 908070? 2 1
Output
13 15 11 101000000127 2812 999756331 999999756
Sample 2of 2multi-test • hover to link
Input
38 48 6 36 3 42 5 47 6 27 1 104 1 45 1 2^ 4^ 7? 7 8? 4 105 63 1 42 3 94 3 65 2 10? 5 7^ 1^ 8? 4 10? 1 9? 3 64 22 1 44 3 52 3 4^ 13? 1 10
Output
14 1313 8 11 1110
58%
1980G.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…