406287: GYM102346 C Crossings With Danger

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. Crossings With Dangertime limit per test1.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

The complete problemset is available on http://maratona.ime.usp.br/primfase19/provas/competicao/maratona_en.pdf

ExamplesInput
5 6 7
2 2 O
3 2 N
4 2 N
4 5 N
2 6 O
5 5 L
2 4 O
Output
4
Input
2 2 3
1 1 L
1 2 O
2 2 N
Output
0
Input
2 2 3
1 1 L
1 2 O
2 1 N
Output
1

加入题单

算法标签: