Submission #525037


Source Code Expand

Copy
classrooms, directions = map(int, raw_input().split())
sources = [0] * directions
targets = [0] * directions
end_points = [0] * (classrooms+2)
for i in range(directions):
	sources[i], targets[i] = map(int, raw_input().split())
	end_points[sources[i]] += 1
	end_points[targets[i] + 1] -= 1

total = 0
for i in range(1,classrooms+1):
	total = end_points[i] = total + end_points[i]

saboreru_directions = [None] * (classrooms+2)
i_direction = 0
for i in range(1,classrooms+1):
	if end_points[i] > 1:
		if end_points[i-1] <= 1:
			i_direction += 1
		saboreru_directions[i] = i_direction

answers = []
for i in range(0,directions):
	if saboreru_directions[sources[i]] == saboreru_directions[targets[i]] \
	   and saboreru_directions[sources[i]] is not None:
		answers.append(i+1)

print len(answers)
for i in answers:
	print i

Submission Info

Submission Time
Task B - ドキドキデート大作戦高橋君
User tasuwo_
Language Python (2.7.3)
Score 100
Code Size 850 Byte
Status
Exec Time 1031 ms
Memory 31216 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 subtask0_sample_01.txt, subtask0_sample_02.txt, subtask0_sample_03.txt
Subtask1 30 / 30 subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask0_sample_01.txt, subtask0_sample_02.txt, subtask0_sample_03.txt
All 70 / 70 subtask0_sample_01.txt, subtask0_sample_02.txt, subtask0_sample_03.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt
Case Name Status Exec Time Memory
subtask0_sample_01.txt 58 ms 3400 KB
subtask0_sample_02.txt 55 ms 3400 KB
subtask0_sample_03.txt 54 ms 3400 KB
subtask1_01.txt 835 ms 24032 KB
subtask1_02.txt 1031 ms 23920 KB
subtask1_03.txt 821 ms 20448 KB
subtask1_04.txt 817 ms 18060 KB
subtask1_05.txt 801 ms 18032 KB
subtask1_06.txt 59 ms 3500 KB
subtask1_07.txt 56 ms 3400 KB
subtask1_08.txt 58 ms 3384 KB
subtask1_09.txt 57 ms 3388 KB
subtask2_01.txt 1021 ms 28776 KB
subtask2_02.txt 1025 ms 31216 KB
subtask2_03.txt 58 ms 3404 KB
subtask2_04.txt 58 ms 3472 KB
subtask2_05.txt 58 ms 3380 KB
subtask2_06.txt 57 ms 3436 KB
subtask2_07.txt 58 ms 3400 KB
subtask2_08.txt 946 ms 24040 KB