cf/mirror

Rollbacks (Easy Version)

CF
1858E12500· grandmaster3s256 MB⌨ stdin/stdout

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
1858E1.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…