Skip to content

ボードゲーム (Board Game)

Unrated
日本語

Language

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

Statement

ボードゲーム:公式日本語問題文 1ページ

ボードゲーム:公式日本語問題文 2ページ

ボードゲーム:公式日本語問題文 3ページ

ボードゲーム:公式日本語問題文 4ページ

ボードゲーム:公式日本語問題文 5ページ

Examples

Sample input 1
5 5 2
1 2
2 3
2 4
3 5
4 5
00000
1 5
Sample output 1
0
1
2
2
3
Sample input 2
5 5 2
1 2
2 3
2 4
3 5
4 5
01000
1 5
Sample output 2
0
1
4
4
5
Sample input 3
5 5 2
1 2
2 3
2 4
3 5
4 5
01100
1 5
Sample output 3
0
1
3
3
4
Sample input 4
8 7 5
1 3
5 7
4 6
2 6
2 3
7 8
1 5
10011010
4 6 4 7 1
Sample output 4
4
2
3
0
10
1
17
24
Sample input 5
12 13 3
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
1 10
2 9
7 12
11 12
110000011101
1 9 11
Sample output 5
0
1
4
5
6
7
8
8
4
1
13
9

Notes

Tags

No tags yet

Source