TopCoder

Caido
$\mathbb{W}\mathcal{aimai}\sim$

User's AC Ratio

96.5% (55/57)

Submission's AC Ratio

55.1% (75/136)

Tags

Description

Input Format

Output Format

Sample Input 1

4 2
2 -2 10000
-2 1 12000
1 -3 12000
4 5 19000
1 5
4 1

Sample Output 1

4
1
2
3

Sample Input 2

3 3
2 0 11000
5 0 12000
3 3 10000
1 3
3 0
5 3

Sample Output 2

1
3
2

Hints

Problem Source

2023 TOI 初選
測資來源:TWPCA GitHub

Subtasks

No. Testdata Range Constraints Score
1 2~7 $n\le 2$ 20
2 0~10 $n\le 100$ 30
3 0~13 無額外限制 50

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 2000 1048576 65536 2 3
1 2000 1048576 65536 2 3
2 2000 1048576 65536 1 2 3
3 2000 1048576 65536 1 2 3
4 2000 1048576 65536 1 2 3
5 2000 1048576 65536 1 2 3
6 2000 1048576 65536 1 2 3
7 2000 1048576 65536 1 2 3
8 2000 1048576 65536 2 3
9 2000 1048576 65536 2 3
10 2000 1048576 65536 2 3
11 2000 1048576 65536 3
12 2000 1048576 65536 3
13 2000 1048576 65536 3