test/cpv_local/ds/st_array.bzoj1012.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // competitive-verifier: LOCALCASE test/cpv_local/_data/bzoj/1012 | ||
| 2 | |||
| 3 | #include "../../../src/ds/rmq/st/lib.hpp" | ||
| 4 | |||
| 5 | using namespace tifa_libs; | ||
| 6 | using std::cin, std::cout; | ||
| 7 | 6034164 | i64 f(i64 x, i64 y) { return std::max(x, y); } | |
| 8 | 8 | int main() { | |
| 9 | u32 m, d; | ||
| 10 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
8 | cin >> m >> d; |
| 11 | 8 | st_array<i64, f> st; | |
| 12 | char op; | ||
| 13 | 8 | i64 t = 0, u; | |
| 14 |
2/2✓ Branch 0 taken 861100 times.
✓ Branch 1 taken 8 times.
|
861108 | for (u32 i = 1; i <= m; ++i) { |
| 15 |
2/4✓ Branch 1 taken 861100 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 861100 times.
✗ Branch 5 not taken.
|
861100 | cin >> op >> u; |
| 16 |
2/2✓ Branch 0 taken 358578 times.
✓ Branch 1 taken 502522 times.
|
861100 | if (op == 'A') st.push_back((u % d + t + d) % d); |
| 17 |
2/4✓ Branch 3 taken 502522 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 502522 times.
✗ Branch 7 not taken.
|
502522 | else cout << (t = st.query(u32(st.size() - u))) << '\n'; |
| 18 | } | ||
| 19 | 8 | } | |
| 20 |