test/cpv_local/ds/mono_stack.bzoj1660.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // competitive-verifier: LOCALCASE test/cpv_local/_data/bzoj/1660 | ||
| 2 | |||
| 3 | #include "../../../src/ds/mono_stack/lib.hpp" | ||
| 4 | |||
| 5 | using namespace tifa_libs; | ||
| 6 | using std::cin, std::cout; | ||
| 7 | 10 | int main() { | |
| 8 | u32 n; | ||
| 9 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | cin >> n; |
| 10 | 10 | mono_stack<u32, std::greater_equal<u32>> stk; | |
| 11 | 10 | u64 ans = 0; | |
| 12 |
2/2✓ Branch 0 taken 316116 times.
✓ Branch 1 taken 10 times.
|
316126 | flt_ (u32, i, 0, n, x) { |
| 13 |
1/2✓ Branch 1 taken 316116 times.
✗ Branch 2 not taken.
|
316116 | cin >> x; |
| 14 | 316116 | stk.pop_greater(x); | |
| 15 | 316116 | ans += stk.size(); | |
| 16 | 316116 | stk.push_nocheck(x); | |
| 17 | } | ||
| 18 |
2/4✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 10 times.
✗ Branch 5 not taken.
|
10 | cout << ans << '\n'; |
| 19 | 10 | } | |
| 20 |