cf/mirror

Rollbacks (Hard Version)

CF
1858E22600· international gm3s256 MB⇄ interactive

Examples

Sample 1of 2
Input
10
+ 1
+ 2
+ 2
?
!
+ 3
- 2
?
+ 1
?
Output
2
1
1
Sample 2of 2
Input
6
+ 1
+ 1000000
?
!
!
?
Output
2
0
1858E2.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…