cf/mirror

Maximum Matching

CF
1038E2400· grandmaster2s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
6
2 1 4
1 2 4
3 4 4
2 8 3
3 16 3
1 32 2
Output
63
Sample 2of 3
Input
7
1 100000 1
1 100000 2
1 100000 2
4 50000 3
3 50000 4
4 50000 4
3 50000 3
Output
300000
Sample 3of 3
Input
4
1 1000 1
2 500 2
3 250 3
4 125 4
Output
1000
1038E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…