#P8695. [蓝桥杯 2019 国 AC] 轨道炮
[蓝桥杯 2019 国 AC] 轨道炮
Problem Description
Xiaoming is playing a war game. There are enemy units on the map, which can be seen as points on a 2D plane. For the -th unit, its position at time is , its direction is (one of up, down, left, right, written as U/D/L/R), and its speed is . Xiaoming’s weapon is a railgun, which can only be used once, but it is extremely powerful. Xiaoming may choose to fire the railgun at some non-negative integer time. Each shot can destroy all enemy units on a single straight line (parallel to the coordinate axes). Please compute the maximum number of enemy units Xiaoming can destroy.
Input Format
The first line contains an integer . The next lines each contain integers , , , and an uppercase character .
Output Format
Output one integer, which is the answer.
4
0 0 1 R
0 10 1 R
10 10 2 D
2 3 2 L
3
Hint
For all test cases, , , .
Lanqiao Cup 2019 National Contest Group A Problem H (Group C Problem J).
Translated by ChatGPT 5