Submission #1243997


Source Code Expand

N, M = map(int, input().split(" "))

student = [];
pos = [];
for i in range(N) :
	a, b = map(int, input().split(" "))
	student.append((a, b))

for i in range(M) :
	a, b = map(int, input().split(" "))
	pos.append((a,b))

for st in student :
	ans = -1;
	score = 100000000;
	for i in range(M) :
		tmpscore = abs(st[0] - pos[i][0]) + abs(st[1] - pos[i][1])
		if score > tmpscore :
			score = tmpscore;
			ans = i;
	print(ans+1);

Submission Info

Submission Time
Task B - Checkpoints
User tokoharu
Language Python (3.4.3)
Score 0
Code Size 446 Byte
Status WA
Exec Time 19 ms
Memory 3064 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 200
Status
AC × 3
AC × 8
WA × 2
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_1.txt, subtask_1_2.txt, subtask_1_3.txt, subtask_1_4.txt, subtask_1_5.txt, subtask_1_6.txt, subtask_1_7.txt
Case Name Status Exec Time Memory
sample_01.txt AC 17 ms 3064 KB
sample_02.txt AC 17 ms 3064 KB
sample_03.txt AC 17 ms 3064 KB
subtask_1_1.txt AC 17 ms 3064 KB
subtask_1_2.txt AC 18 ms 3064 KB
subtask_1_3.txt AC 17 ms 3064 KB
subtask_1_4.txt WA 17 ms 3064 KB
subtask_1_5.txt WA 17 ms 3064 KB
subtask_1_6.txt AC 17 ms 3064 KB
subtask_1_7.txt AC 19 ms 3064 KB