Skip to content

細長い屋敷 (Long Mansion)

Unrated
日本語

Language

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

Statement

細長い屋敷 (Long Mansion):公式日本語問題文 1ページ

細長い屋敷 (Long Mansion):公式日本語問題文 2ページ

細長い屋敷 (Long Mansion):公式日本語問題文 3ページ

細長い屋敷 (Long Mansion):公式日本語問題文 4ページ

Examples

Sample input 1
5
1 2 3 4
2 2 3
1 1
1 1
1 3
1 4
4
2 4
4 2
1 5
5 3
Sample output 1
YES
NO
NO
YES
Sample input 2
5
2 3 1 3
1 3
1 2
1 1
1 3
1 2
4
1 3
3 1
4 3
2 5
Sample output 2
NO
YES
NO
YES
Sample input 3
7
6 3 4 1 2 5
1 1
1 5
1 1
1 1
2 2 3
1 4
1 6
3
4 1
5 3
4 7
Sample output 3
YES
NO
YES

Notes

Tags

No tags yet

Source