Skip to content

Keys

UnratedFunction
English

Language

Contribute a translation
Time limit
2000 ms
Memory limit
2048 MB
Submissions
0
Correct
0
Solved by
0
AC rate
—

Statement

Keys: original English statement, page 1

Keys: original English statement, page 2

Keys: original English statement, page 3

Keys: original English statement, page 4

Examples

Sample input 1
4 5
0 1 1 2
0 1 0
0 2 0
1 2 1
1 3 0
3 1 2
Sample output 1
0 1 1 0
Sample input 2
7 10
0 1 1 2 2 1 2
0 1 0
0 2 0
1 2 1
1 3 0
2 3 0
3 4 1
3 5 2
4 5 0
4 6 2
5 6 1
Sample output 2
0 1 1 0 1 0 1
Sample input 3
3 1
0 0 0
0 1 0
Sample output 3
0 0 1

Tags

No tags yet

Source

This problem accepts only these languages.

C++20