test/cpv/aizu-dpl/dpl_1_c.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // competitive-verifier: PROBLEM https://onlinejudge.u-aizu.ac.jp/courses/library/7/DPL/all/DPL_1_C | ||
| 2 | #include "../../../src/opt/knapsack/mixed/lib.hpp" | ||
| 3 | |||
| 4 | using namespace tifa_libs; | ||
| 5 | 40 | int main() { | |
| 6 |
1/2✓ Branch 2 taken 40 times.
✗ Branch 3 not taken.
|
40 | std::cin.tie(nullptr)->std::ios::sync_with_stdio(false); |
| 7 | u32 n, w; | ||
| 8 |
2/4✓ Branch 1 taken 40 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 40 times.
✗ Branch 5 not taken.
|
40 | std::cin >> n >> w; |
| 9 | 40 | knapsack_mixed<i32> kn(w); | |
| 10 |
2/2✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 40 times.
|
1960 | for (u32 i = 0; i < n; ++i) { |
| 11 | i32 v; | ||
| 12 | u32 w; | ||
| 13 |
2/4✓ Branch 1 taken 1920 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1920 times.
✗ Branch 5 not taken.
|
1920 | std::cin >> v >> w; |
| 14 | 1920 | kn.add(w, v, 0); | |
| 15 | } | ||
| 16 |
2/4✓ Branch 3 taken 40 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 40 times.
✗ Branch 7 not taken.
|
40 | std::cout << std::ranges::max(kn.result()) << '\n'; |
| 17 | 40 | return 0; | |
| 18 | 40 | } | |
| 19 |