Skip to content

ぴょんぴょん川渡り

UnratedLanguage limit
日本語

Language

Contribute a translation
Time limit
1000 ms
Memory limit
64 MB (no extra memory)
Submissions
0
Correct
0
Solved by
0
AC rate
—

Statement

ぴょんぴょん川渡り

ぴょんぴょん川渡り

ぴょんぴょん川渡り

Examples

Sample input 1
5 1
2 1 3 2 2
1 3 2
1 1 7
1 2 1
1 4 4
Sample output 1
17
Sample input 2
5 0
2 1 3 2 2
1 3 2
1 1 7
1 2 1
1 4 4
Sample output 2
40

Notes

原典:JOI 2007/2008 本選、情報オリンピック日本委員会。CC BY-SA 4.0。

Tags

No tags yet

Source

This problem accepts only these languages.

C++20