problem_id
stringlengths 6
6
| user_id
stringlengths 10
10
| time_limit
float64 1k
8k
| memory_limit
float64 262k
1.05M
| problem_description
stringlengths 48
1.55k
| codes
stringlengths 35
98.9k
| status
stringlengths 28
1.7k
| submission_ids
stringlengths 28
1.41k
| memories
stringlengths 13
808
| cpu_times
stringlengths 11
610
| code_sizes
stringlengths 7
505
|
---|---|---|---|---|---|---|---|---|---|---|
p03773 | u699347638 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['import math\ndef digit(X):\n d = 0\n while X:\n X //= 10\n d += 1\n return d\n\ndef F(A, B):\n return max(digit(A), digit(B))\n\nN = int(input())\n\nmin_F = 20\nmax_div = round(math.sqrt(N))\nfor i in range(1, max_div):\n if N % i == 0:\n f = F(i, N/i)\n if f < min_F:\n min_F = f\nprint(min_F)\n\n', 'A, B = map(int, input().split())\nprint((A + B) % 24)\n'] | ['Runtime Error', 'Accepted'] | ['s672360627', 's089612348'] | [3060.0, 3316.0] | [17.0, 20.0] | [330, 53] |
p03773 | u699522269 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['A,B = map(int,input().split())\nreturn A+B % 24', 'A,B = map(int,input().split())\nprint((A+B) % 24)'] | ['Runtime Error', 'Accepted'] | ['s754744636', 's234389287'] | [8896.0, 9092.0] | [24.0, 24.0] | [46, 48] |
p03773 | u703890795 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['A B = map(int, input().split())\nprint((A+B)%24)\n', 'A B = map(int, input().split())\nprint((A+B)%24)', 'A, B = map(int, input().split())\nprint((A+B)%24)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s058863408', 's092626980', 's939113889'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [48, 47, 49] |
p03773 | u706884679 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['l = input().split()\nA = l[0]\nB = l[1]\nT = A + B\nif T < 24:\n\tprint(T)\nelse:\n\tprint(T-24)', 'l = input().split()\nA = int(l[0])\nB = int(l[1])\n\nT = int(A + B)\nif T < 24:\n\tprint(T)\nelse:\n\tprint(T - 24)'] | ['Runtime Error', 'Accepted'] | ['s743214012', 's122183504'] | [2940.0, 2940.0] | [18.0, 17.0] | [87, 105] |
p03773 | u712768978 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['print((int(input())+int(input()))%24)', 'a, b = map(int, input().split())\nprint((a+b)%24)'] | ['Runtime Error', 'Accepted'] | ['s770164691', 's210986530'] | [2940.0, 2940.0] | [17.0, 17.0] | [37, 48] |
p03773 | u729535891 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['A, B = map(int, input())\nprint((A + B) % 24)', 'A, B = map(int, input().split())\nprint((A + B) % 24)\n'] | ['Runtime Error', 'Accepted'] | ['s977989525', 's431299248'] | [2940.0, 2940.0] | [17.0, 20.0] | [44, 53] |
p03773 | u732844340 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['a = list(map(int, input().split()))\nprint(int((a[0] + a[1]) / 24))', 'a = list(map(int, input().split()))\nprint(int((a[0] + a[1]) % 24))'] | ['Wrong Answer', 'Accepted'] | ['s847443324', 's595272189'] | [2940.0, 2940.0] | [17.0, 17.0] | [66, 66] |
p03773 | u739798900 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['time_input = input()\ntime = time_input.split()\n\nA = time[0]\nB = time[1]\n\nif A + B > 24:\n print(A + B - 24)\nelif A + B == 24:\n print(0)\nelse:\n print(A + B)', 'time_input = input()\ntime = time_input.split()\n\nA = int(time[0])\nB = int(time[1])\n\nif A + B >= 24:\n print(A + B - 24)\n\nelse:\n print(A + B)'] | ['Runtime Error', 'Accepted'] | ['s338185633', 's611386398'] | [2940.0, 2940.0] | [18.0, 17.0] | [163, 144] |
p03773 | u740047492 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['A. B = map(int, input().split())\nif A + B >= 24:\n print((A + B) - 24)\nelse:\n print(A + B)', 'A, B = map(int, input().split())\nif A + B >= 24:\n print(A + B)\nelse:\n print((A + B) - 24)', 'a, b = map(int, input().split())\nA = a+b\nif A > 24:\n print(A-24)\nelif A < 24:\n print(A)\nelif A == 24:\n print("0")'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s253515597', 's902001650', 's692980198'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 18.0] | [91, 91, 116] |
p03773 | u740767776 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['A, B = int(input().split())\nif A + B > 24:\n print(A + B -24)\nelse:\n print(A + B)', 'A, B = map(int,input().split())\nif A + B >= 24:\n print(A + B -24)\nelse:\n print(A + B)'] | ['Runtime Error', 'Accepted'] | ['s191053638', 's690760820'] | [2940.0, 2940.0] | [18.0, 17.0] | [82, 87] |
p03773 | u748135969 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['a, b = int(map, input().split())\n\nh = a + b\n\nif h < 24:\n print(h)\nelse:\n print(24 - h)', 'a, b = map(int, input().split())\n \nh = a + b\n \nif h < 24:\n print(h)\nelse:\n print(h - 24)'] | ['Runtime Error', 'Accepted'] | ['s882986235', 's290533274'] | [2940.0, 2940.0] | [17.0, 17.0] | [88, 90] |
p03773 | u762540523 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['a,b=map(int, input().split());print((a+b)//24)', 'a,b=map(int, input().split());print((a+b)%24)'] | ['Wrong Answer', 'Accepted'] | ['s627902663', 's591696098'] | [2940.0, 2940.0] | [18.0, 18.0] | [46, 45] |
p03773 | u762603420 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['N, M = list(map(int, input().split()))\n\na = []\nc = []\nfor i in range(0, N + M):\n s = list(map(int, input().split()))\n if i < N:\n a.append(s)\n else:\n c.append(s)\n\nfor i in range(0, N):\n min_idx = 0\n min_dis = 999999999999\n for j in range(0, M):\n dis = abs(a[i][0] - c[j][0]) + abs(a[i][1] - c[j][1])\n if min_dis > dis:\n min_dis = dis\n min_idx = j + 1\n print(str(min_idx))', 'N, S = list(map(int, input().split()))\ns = N + S\nif s >= 24:\n s = s - 24\nprint(str(s))'] | ['Runtime Error', 'Accepted'] | ['s309896863', 's354319920'] | [3064.0, 3316.0] | [17.0, 21.0] | [442, 89] |
p03773 | u766407523 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['print(sum(list(map(int, input().split())))//24)', 'print(sum(list(map(int, input().split())))%24)'] | ['Wrong Answer', 'Accepted'] | ['s955622971', 's186971813'] | [2940.0, 2940.0] | [17.0, 17.0] | [47, 46] |
p03773 | u785205215 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['def read_int_list():\n return list(int(i) for i in input().split())\nx,y = read_int_list()\nprint((x+y)%12)', 'def read_int_list():\n return list(int(i) for i in input().split())\n \nx,y = read_int_list()\nprint((x+y)%24)\n'] | ['Wrong Answer', 'Accepted'] | ['s976339469', 's334690638'] | [2940.0, 2940.0] | [17.0, 17.0] | [107, 113] |
p03773 | u786020649 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['a,b=map(int,input())\n\nprint((a+b)%24)', 'a,b=map(int,input().split())\n \nprint((a+b)%24)'] | ['Runtime Error', 'Accepted'] | ['s858452975', 's333480220'] | [9048.0, 9080.0] | [25.0, 26.0] | [37, 46] |
p03773 | u790865353 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['A,B=map(int,input().split())\nprint((a + b) % 24)', 'A,B=map(int,input().split())\nprint((A + B) % 24)'] | ['Runtime Error', 'Accepted'] | ['s636740144', 's758746036'] | [2940.0, 2940.0] | [17.0, 17.0] | [48, 48] |
p03773 | u794543767 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['import sys\na = sys.stdin.readline()\na,b = a.strip().split(" ")\nprint((int(a)-int(b))/24)', 'print(A+B/24)', 'import sys\na = sys.stdin.readline()\na,b = a.strip().split(" ")\nprint((int(a)+int(b))%24)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s145740738', 's284989906', 's424620583'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [88, 13, 88] |
p03773 | u835575472 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['a, b = map(int, input().split)\nprint((a + b) % 24)', 'a, b = map(int, input().split())\nprint((a + b) % 24)\n'] | ['Runtime Error', 'Accepted'] | ['s622866082', 's326744995'] | [9032.0, 9140.0] | [24.0, 25.0] | [50, 53] |
p03773 | u841623074 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['N=int(input())\nn=len(str(N))\nm=(n//2)\ndef wari(x):\n array=[]\n if m==0:\n for j in range(9,0,-1):\n if N%j==0:\n c=max(len(str(N//j)),len(str(j)))\n array.append(c)\n break\n \n for i in range(m+1):\n if i==0:\n for j in range(9,0,-1):\n if N%j==0:\n c=max(len(str(N//j)),len(str(j)))\n array.append(c)\n break\n else:\n for j in range((10**(i+1))-1,(10**i)-1,-1):\n if N%j==0:\n c=max(len(str(N//j)),len(str(j)))\n array.append(c)\n break\n return min(array)\nprint(wari(N))', 'A,B=map(int,input().split())\nprint((A+B)%24)'] | ['Runtime Error', 'Accepted'] | ['s532115101', 's947128859'] | [3064.0, 2940.0] | [18.0, 18.0] | [715, 44] |
p03773 | u850582941 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['A = int(input())\nB = int(input())\n\nans1 = A + B\n\n\nif ans1 >= 24:\n ans2 = ans1 - 24\n print(ans2)\nelse:\n print(ans1)\n \n \n ', 'A,B = map(int,input().split())\n\nans1 = A + B\n\n\nif ans1 >= 24:\n ans2 = ans1 - 24\n print(ans2)\nelse:\n print(ans1)\n \n \n \n'] | ['Runtime Error', 'Accepted'] | ['s856607830', 's399082561'] | [2940.0, 2940.0] | [17.0, 17.0] | [138, 136] |
p03773 | u852790844 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['a, b = map(int, input())\nans = (a+b)%24\nprint(ans)', 'a, b = map(int, input().split())\nans = (a+b)%24\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s066780121', 's773589290'] | [2940.0, 2940.0] | [17.0, 17.0] | [50, 58] |
p03773 | u853900545 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['a,b = map(int,input().splilt())\nprint((a+b)//24)', 'a,b = map(int,input().split())\nprint((a+b)%24)\n'] | ['Runtime Error', 'Accepted'] | ['s022608508', 's331004407'] | [2940.0, 2940.0] | [17.0, 17.0] | [48, 47] |
p03773 | u854627522 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['import sys\na, b = sys.stdin.readline().split()\n\nprint((a+b)%24)', 'import sys\na, b = map(int, sys.stdin.readline().split())\n\nprint((a+b)%24)\n'] | ['Runtime Error', 'Accepted'] | ['s700889294', 's773705228'] | [2940.0, 2940.0] | [17.0, 18.0] | [63, 74] |
p03773 | u860002137 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['A, B = map(int, input().split())\nprint((A + B) // 24)', 'A, B = map(int, input().split())\nprint((A + B) % 24)'] | ['Wrong Answer', 'Accepted'] | ['s972143704', 's995565734'] | [2940.0, 2940.0] | [17.0, 17.0] | [53, 52] |
p03773 | u863370423 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['a,b=map(int,input().split())\nif (a>b):\n s=a+b\n s=s%24\nif (b>=a):\n s=a-b\nif (s<=0):\n s=s*-1\n\nprint(s)\n\n', 'a, b=input().split(" ")\na=float(a)\nb=float(b)\ns=a-b\nif( s> 0 and s<=24 ):\n t=b-a\nif(s <=0 ):\n tm=s%24\n t=24+tm\n \nif (s<24 ):\n tm=s%24\n t=24-tm\nprint(\'%d\'%t)\n\n\n', 'a, b = list(map(lambda x: int(x), input().split(" ")))\n\nprint((a+b)%24)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s391186097', 's910537168', 's624804511'] | [2940.0, 3060.0, 2940.0] | [17.0, 17.0, 17.0] | [114, 177, 71] |
p03773 | u864565901 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['print((int(input())+int(input()))%24)', 'print(sum(map(int,input().split()))%24)'] | ['Runtime Error', 'Accepted'] | ['s839715071', 's212060627'] | [2940.0, 2940.0] | [17.0, 17.0] | [37, 39] |
p03773 | u865413330 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['a, b = map(int, input().split())\nprint(a + b) if a + b > 24 else print(a + b - 24)', 'a, b = map(int, input().split())\nprint(a + b) if a + b < 24 else print(a + b - 24)'] | ['Wrong Answer', 'Accepted'] | ['s382625973', 's912750052'] | [2940.0, 2940.0] | [17.0, 17.0] | [82, 82] |
p03773 | u869519920 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['a, b = map(int, input().split())\nprint((a+b)//24)', 'a, b = map(int, input().split())\nprint((a+b)%24)'] | ['Wrong Answer', 'Accepted'] | ['s809884281', 's526996035'] | [9028.0, 9152.0] | [26.0, 30.0] | [49, 48] |
p03773 | u871596687 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['a,b = map(int,input().split())\n\nif a+b>24\n print(a+b-24)\nelse:\n print(a+b)\n', 'a,b = map(int,input().split())\n\nif a+b>=24:\n print(a+b-24)\nelse:\n print(a+b)\n\n\n'] | ['Runtime Error', 'Accepted'] | ['s077848735', 's131631942'] | [2940.0, 2940.0] | [17.0, 17.0] | [81, 85] |
p03773 | u871841829 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['A\n \nB\n', 'A,B = map(int, input().split())\n\nans = None\n\nif A+B > 23:\n ans = A+B-24\nelse:\n ans = A+B\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s270739387', 's209468257'] | [2940.0, 2940.0] | [17.0, 17.0] | [6, 102] |
p03773 | u886902015 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['a,b=int(input().split())\nprint((a+b)%24)', 'a,b=map(int,input().split())\nprint((a+b)%24)'] | ['Runtime Error', 'Accepted'] | ['s457471392', 's723914368'] | [8952.0, 9084.0] | [24.0, 28.0] | [40, 44] |
p03773 | u891438775 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['def r_t(n):\n return sum(map(int, n.split()))%24\nr_t(input())', 'def r_t(n):\n return sum(map(int, n.split()))%24\nprint(r_t(input()))'] | ['Wrong Answer', 'Accepted'] | ['s692309802', 's510999845'] | [2940.0, 2940.0] | [17.0, 17.0] | [63, 70] |
p03773 | u895040371 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['a, b =map(in, input().split())\nprint((a+b)%24)', 'a, b = map(int, input().split())\nprint((a + b)%24)'] | ['Runtime Error', 'Accepted'] | ['s041357963', 's737427264'] | [2940.0, 2940.0] | [17.0, 17.0] | [46, 50] |
p03773 | u904804404 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['print((lambda a,b : (a+b)//24)(list(map(int,input().split())) ))', 'print((lambda a : (a[0]+a[1])%24)(list(map(int,input().split())) ))\n'] | ['Runtime Error', 'Accepted'] | ['s016225519', 's533814656'] | [3064.0, 2940.0] | [17.0, 18.0] | [64, 68] |
p03773 | u918009437 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['a,b = map(int,input().split())\n\nprint(a+b-24)', 'a,b = map(int,input().split())\n\nif (a+b>=24):\n print(a+b-24)\nelse:\n print(a+b)\n'] | ['Wrong Answer', 'Accepted'] | ['s399379498', 's934246484'] | [2940.0, 2940.0] | [17.0, 17.0] | [45, 81] |
p03773 | u923659712 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['a.b=map(int,input().split())\nprint((a+b)%24)', 'n,a,b=map(int,input().split())\nv=list(map(int,input().split()))\nv.sort()\nv.reverse()\nave=0\nfor i in range(a):\n ave+=v[i]\n \nprint(ave/a)\n\nl=0\nfor j in range(a,b):\n if v[a-1]==v[j]:\n l+=1\n \np=v.count(v[a-1])\n\nfrom math import factorial\na=factorial(p) / factorial(p-l) / factorial(l)\nprint(a)\n ', 'a,b=map(int,input().split())\nprint((a+b)%24)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s148538729', 's773265932', 's367868034'] | [2940.0, 3064.0, 2940.0] | [18.0, 18.0, 17.0] | [44, 301, 45] |
p03773 | u945028875 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['AB = input()\nABL= AB.replace("\\n", " ").split(" ")\n\nprint(ABL)\nA = ABL[0]\nif len(ABL) == 1:\n C = A\nB = ABL[1]\nC = int(A) + int(B )\nif C >= 24:\n C -= 24\nprint(C)\n', 'AB =input()\nif len(AB) <= 2:\n ABL = [AB]\nelse:\n ABL= AB.replace("\\n", " ").split(" ")\n\nprint(ABL)\nA = int(ABL[0])\nif len(ABL) <= 2:\n C = A\nelse:\n B = ABL[1]\n C = int(A) + int(B )\nif C >= 24:\n C -= 24\nprint(C)\n', 'AB =input()\nif len(AB) <= 2:\n ABL = [AB]\nelse:\n ABL= AB.replace("\\n", " ").split(" ")\n\n\nA = int(ABL[0])\nif len(ABL) <= 2:\n C = A\nelse:\n B = ABL[1]\n C = int(A) + int(B )\nif C >= 24:\n C -= 24\nprint(C)\n', 'A = int(input())\nB = int(input())\nC = A + B \nif C >= 24:\n C -= 24\nprint(C)\n', 'AB = input()\nif len(AB) <= 2:\n ABL = [AB]\nelse:\n ABL= AB.replace("\\n", " ").split(" ")\n\n\n\nA = int(ABL[0])\nif len(AB) <= 2:\n C = A\nelse:\n B = ABL[1]\n C = int(A) + int(B )\n \nif C >= 24:\n C -= 24\nprint(C)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s071264931', 's088821548', 's604745920', 's951004342', 's106834814'] | [2940.0, 3060.0, 3060.0, 2940.0, 2940.0] | [18.0, 17.0, 17.0, 17.0, 17.0] | [167, 227, 217, 78, 222] |
p03773 | u951582245 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['A,B = map(int,input().split())\nprint((A+B)//24)', 'A,B = map(int,input().split())\nprint((A+B)%24)'] | ['Wrong Answer', 'Accepted'] | ['s539464800', 's476915124'] | [2940.0, 2940.0] | [17.0, 17.0] | [47, 46] |
p03773 | u958506960 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['a, b = map(int, input().split())\nprint(a+b//24)', 'a, b = map(int, input().split())\nprint((a+b)%24)'] | ['Wrong Answer', 'Accepted'] | ['s728510632', 's203718524'] | [2940.0, 2940.0] | [17.0, 17.0] | [47, 48] |
p03773 | u960513073 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['a,b = list(map(int, input().split()))\nprint(mod(a+b))', 'a,b = list(map(int, input().split()))\nprint((a+b)%24)'] | ['Runtime Error', 'Accepted'] | ['s542901035', 's051489329'] | [2940.0, 2940.0] | [18.0, 17.0] | [53, 53] |
p03773 | u972892985 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['a, b = map(int,input().split())\nprint((a+b)%12)', 'a, b = map(int,input().split())\nprint((a+b)%24)\n'] | ['Wrong Answer', 'Accepted'] | ['s968663126', 's623636174'] | [2940.0, 2940.0] | [17.0, 17.0] | [47, 48] |
p03773 | u975024434 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['import sys\n\nsys.setrecursionlimit(10000)\n\n\ndef memoize(f):\n cache = {}\n\n def func(*args):\n if args not in cache:\n cache[args] = f(*args)\n return cache[args]\n\n return func\n\n\n@memoize\n\n\n\ndef combi(n, r):\n if r == 0 or n == r:\n return 1\n return combi(n-1, r-1) + combi(n-1, r)\n\nn, a, b = map(int, input().split())\nitems = sorted(map(int, input().split()), reverse=True)\nmax_ave_list = items[:a]\nprint(sum(max_ave_list)/len(max_ave_list))\n\nm = max_ave_list.count(max_ave_list[-1])\nl = items.count(max_ave_list[-1])\nif l == m:\n print(1)\nelif max_ave_list[0] != max_ave_list[-1]:\n print(combi(l, m))\nelse:\n print(sum(combi(l, k) for k in range(m, min(b, l) + 1)))', 'b = input().split()\na = [int(b[i]) for i in range(len(b))]\n\nif(a[0] + a[1] >= 24 ):\n print(a[0] + a[1] - 24)\nelse:\n print(a[0] + a[1])\n\n '] | ['Runtime Error', 'Accepted'] | ['s639369800', 's795503115'] | [3064.0, 2940.0] | [17.0, 17.0] | [699, 140] |
p03773 | u986269893 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['num=input().split(" ")\na=num[0]\nb=num[1]\nif a+b>=24:\n\tprint(a+b-24)\nelse:\n\tprint(a+b)', 'num=input().split(" ")\na=int(num[0])\nb=int(num[1])\nif a+b>=24:\n\tprint(a+b-24)\nelse:\n\tprint(a+b)'] | ['Runtime Error', 'Accepted'] | ['s974667622', 's050545433'] | [2940.0, 3064.0] | [17.0, 24.0] | [85, 95] |
p03773 | u989008537 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['N, A, B = map(int, input().split())\nL = list(map(int, input().split()))\n\nnum = [0 for x in range(N)]\ntotal = [0 for x in range(N)]\n\nfor i, v in enumerate(L):\n for j in reversed(range(1, i + 1)):\n new_v = total[j - 1] + v\n if(new_v > total[j]):\n total[j] = new_v\n num[j] = num[j - 1]\n elif(new_v == total[j]):\n num[j] = num[j] + num[j - 1]\n\n if(v > total[0]):\n total[0] = v\n num[0] = 1\n elif(v == total[0]):\n num[0] = num[0] + 1\n\nprint(total)\ntotal = [x / (i + 1) for i, x in enumerate(total)]\ntotal = total[(A - 1):B]\nnum = num[(A - 1):B]\n\nmaxV = max(total)\nmaxNum = sum([j for i, j in zip(total, num) if i == maxV])\nprint(maxV)\nprint(maxNum)', "if __name__ == '__main__':\n h1 = input()\n a, b = h1.split()\n print((int(a) + int(b)) % 24)"] | ['Runtime Error', 'Accepted'] | ['s897069629', 's555681244'] | [3064.0, 3064.0] | [17.0, 17.0] | [726, 99] |
p03773 | u989326345 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['A,B=map(int,input().split())\nans=(A+B)//24\nprint(ans)\n', 'A,B=map(int,input().split())\nans=(A+B)%24\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s180988378', 's584670081'] | [2940.0, 2940.0] | [17.0, 17.0] | [54, 53] |
p03773 | u992910889 | 2,000 | 262,144 | Dolphin loves programming contests. Today, he will take part in a contest in AtCoder. In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock". The current time is A o'clock, and a contest will begin in exactly B hours. When will the contest begin? Answer in 24-hour time. | ['A,B=map(str,input().split())\n#print(sorted(B)[0])\nprint((A+B)%24)', 'A,B=map(int,input().split())\n#print(sorted(B)[0])\nprint((A+B)%24)'] | ['Runtime Error', 'Accepted'] | ['s738056989', 's929284073'] | [2940.0, 2940.0] | [17.0, 17.0] | [65, 65] |
p03774 | u013408661 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n,m=map(int,input().split())\nstudent=[]\nman=[]\nfor i in range(n):\n x,y=map(int,input().split())\n student.append([x,y])\nfor i in range(m):\n x,y=map(int,input().split())\n man.append([x,y])\nfor i in student:\n ans=[]\n for j in man:\n ans.append(abs(i[0]-j[0])+abs(i[1]-j[1]))\n print(ans.index(max(ans))+1)', 'n,m=map(int,input().split())\nstudent=[]\nman=[]\nfor i in range(n):\n x,y=map(int,input().split())\n student.append([x,y])\nfor i in range(m):\n x,y=map(int,input().split())\n man.append([x,y])\nfor i in student:\n ans=[]\n for j in man:\n ans.append(abs(i[0]-j[0])+abs(i[1]-j[1]))\n print(ans.index(max(ans)))', 'n,m=map(int,input().split())\nstudent=[]\nman=[]\nfor i in range(n):\n x,y=map(int,input().split())\n student.append([x,y])\nfor i in range(m):\n x,y=map(int,input().split())\n man.append([x,y])\nfor i in student:\n ans=[]\n for j in man:\n ans.append(abs(i[0]-j[0])+abs(i[1]-j[1]))\n print(ans.index(min(ans))+1)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s353260642', 's935910680', 's040988407'] | [3064.0, 3064.0, 3064.0] | [19.0, 19.0, 18.0] | [310, 308, 310] |
p03774 | u016323272 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['N,M = map(int,input().split())\nLs = []\nLp = []\nfor i in range(N):\n a,b = map(int,input().split())\n Ls.append([a,b])\nfor m in range(M):\n c,d = map(int,input().split())\n Lp.append([c,d])\ndis =[]\nfor i in range(N):\n for m in range(M):\n dis.append(abs(Ls[i][0]-Lp[m][0])+abs(Ls[i][1]-Lp[m][1]))\n print(dis.index(min(dis))+1)', 'N,M = map(int,input().split())\nLs = []\nLp = []\nfor i in range(N):\n a,b = map(int,input().split())\n Ls.append(a)\n Ls.append(b)\nfor m in range(M):\n c,d = map(int,input().split())\n Lp.append(c)\n Lp.append(d)\nfor i in range(N):\n dis = []\n for m in range(M):\n dis.append(abs(Ls[i][0]-Lp[m][0])+abs(Ls[i][1]-Lp[m][1]))\n print(dis.index(min(dis))+1)', '#ABC057.B\nN,M = map(int,input().split())\nL1 = []\nL2 = []\n\nfor i in range(N):\n a,b = map(int,input().split())\n L1.append([a,b])\nfor m in range(M):\n c,d = map(int,input().split())\n L2.append([c,d])\n\nfor j in range(N):\n L3 = []\n for l in range(M):\n L3.append(abs(L1[j][0]-L2[l][0]) + abs(L1[j][1]-L2[l][1]))\n print(L3.index(min(L3)+1)', '#ABC057.B\nN,M = int(input().split())\nL1 = []\nL2 = []\n\nfor i in range(N):\n a,b = map(int,input().split())\n L1.append([a,b])\nfor m in range(M):\n c,d = map(int,input().split())\n L2.append([c,d])\n\nL3 = []\nfor j in range(N):\n for l in range(M):\n L3.append(abs(L1[j][0]-L2[l][0]) + abs(L1[j][1]-L2[l][1]))\n print(L3.index(min(L3))+1)', '#ABC057.B\nN,M = int(input().split())\nL1 = []\nL2 = []\n\nfor i in range(N):\n a,b = map(int,input().split())\n L1.append([a,b])\nfor m in range(M):\n c,d = map(int,input().split())\n L2.append([c,d])\n\nL3 = []\nfor j in range(N):\n for l in range(M):\n L3.append(abs(L1[j][0]-L2[l][0])+abs(L1[j][1]-L2[l][1]))\n print(L3.index(min(L3[j])+1))', 'N,M = map(int,input().split())\nLs = []\nLp = []\nfor i in range(N):\n a,b = map(int,input().split())\n Ls.append(a)\n Ls.append(b)\nfor m in range(M):\n c,d = map(int,input().split())\n Lp.append(c)\n Lp.append(d)\n\nfor i in range(N):\n for m in range(M):\n dis = list(abs(Ls[i][0]-Lp[m][0])+abs(Ls[i][1]-Lp[m][1]))\n print(dis.index(min(dis))+1)', '#ABC057.B\nN,M = int(input().split())\nL1 = []\nL2 = []\n\nfor i in range(N):\n a,b = map(int,input().split())\n L1.append([a,b])\nfor m in range(M):\n c,d = map(int,input().split())\n L2.append([c,d])\n\nfor j in range(N):\n L3 = []\n for l in range(M):\n L3.append(abs(L1[j][0]-L2[l][0]) + abs(L1[j][1]-L2[l][1]))\n print(L3.index(min(L3))+1)', 'N,M = map(int,input().split())\nLs = []\nLp = []\nfor i in range(N):\n a,b = map(int,input().split())\n Ls.append([a,b])\nfor m in range(M):\n c,d = map(int,input().split())\n Lp.append([c,d])\nfor i in range(N):\n dis = []\n for m in range(M):\n dis.append(abs(Ls[i][0]-Lp[m][0])+abs(Ls[i][1]-Lp[m][1]))\n print(dis.index(min(dis))+1)'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s089589617', 's498566642', 's660875506', 's736653594', 's803720486', 's832354212', 's888566176', 's967271503'] | [3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0] | [21.0, 18.0, 18.0, 17.0, 18.0, 18.0, 17.0, 19.0] | [345, 376, 359, 352, 353, 364, 356, 350] |
p03774 | u020604402 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['students = []\nfor _ in range(N):\n l = list(map(int,input().split()))\n students.append(l)\n\ncheck_points = []\n\nfor _ in range(M):\n l = list(map(int,input().split()))\n check_points.append(l)\n\nminimum_points = 0\n\nfor person in students:\n minimum = 10**10\n for i in range(len(check_points)):\n d=abs(person[0]-check_points[i][0])+abs(person[1]-check_points[i][1])\n if minimum > d:\n minimum = d\n minimum_points = i\n print(minimum_points+1)\n', 'N, M = map(int,input().split())\nstudents = []\nfor _ in range(N):\n l = list(map(int,input().split()))\n students.append(l)\n\ncheck_points = []\n\nfor _ in range(M):\n l = list(map(int,input().split()))\n check_points.append(l)\n\nminimum_points = 0\n\nfor person in students:\n minimum = 10**10\n for i in range(len(check_points)):\n d=abs(person[0]-check_points[i][0])+abs(person[1]-check_points[i][1])\n if minimum > d:\n minimum = d\n minimum_points = i\n print(minimum_points+1)'] | ['Runtime Error', 'Accepted'] | ['s272372766', 's121026074'] | [3064.0, 3064.0] | [18.0, 19.0] | [490, 521] |
p03774 | u023229441 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n,m=map(int,input().split())\nA=[]\nB=[]\nfor i in range(n):\n A.append(list(map(int,input().split())))\nfor i in range(m):\n B.append(list(map(int,input().split())))\n\nfor i in A:\n man=1000000000\n for j in B:\n man=min(man,abs(i[0]-j[0])+abs(i[1]-j[1]))\n print(man)', 'n,m=map(int,input().split())\nA=[]\nB=[]\nfor i in range(n):\n A.append(list(map(int,input().split())))\nfor i in range(m):\n B.append(list(map(int,input().split())))\n\nfor i in range(n):\n man=1000000000\n ans=0\n for j in range(m):\n if abs(A[i][0]-B[j][0])+abs(A[i][1]-B[j][1])<man:\n man=abs(A[i][0]-B[j][0])+abs(A[i][1]-B[j][1])\n ans=j\n print(ans)', 'n,m=map(int,input().split())\nA=[]\nB=[]\nfor i in range(n):\n A.append(list(map(int,input().split())))\nfor i in range(m):\n B.append(list(map(int,input().split())))\n\nfor i in range(n):\n man=1000000000\n ans=0\n for j in range(m):\n if abs(A[i][0]-B[j][0])+abs(A[i][1]-B[j][1])<man:\n man=abs(A[i][0]-B[j][0])+abs(A[i][1]-B[j][1])\n ans=j+1\n print(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s015748443', 's372542786', 's410622295'] | [3064.0, 3064.0, 3064.0] | [18.0, 18.0, 18.0] | [266, 359, 362] |
p03774 | u026155812 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['N, M = [int(i) for i in input().split()]\nA = [[int(i) for i in input().split()] for j in range(N)]\nC = [[int(i) for i in input().split()] for j in range(M)]\n\nls1 = []\nfor i in range(N):\n ls2 = []\n for j in range(M):\n ls2.append(abs(A[i][0] - C[j][0]) + abs(A[i][1] - C[j][1]))\n a = min(ls2)\n ls1.append(ls2.index(a))\nfor i in ls1:\n print(i)', 'N, M = [int(i) for i in input().split().strip()]\nA = [[int(i) for i in input().split().strip()] for j in range(N)]\nC = [[int(i) for i in input().split().strip()] for j in range(M)]\n\nls1 = []\nfor i in range(N):\n ls2 = []\n for j in range(M):\n ls2.append(abs(A[i][0] - C[j][0]) + abs(A[i][1] - C[j][1]))\n a = min(ls2)\n ls1.append(ls2.index(a))\nfor i in ls1:\n print(i)', 'N, M = [int(i) for i in input().split()]\nA = [[int(i) for i in input().split()] for j in range(N)]\nC = [[int(i) for i in input().split()] for j in range(M)]\n\nls1 = []\nfor i in range(N):\n ls2 = []\n for j in range(M):\n ls2.append(abs(A[i][0] - C[j][0]) + abs(A[i][1] - C[j][1]))\n a = min(ls2)\n ls1.append(ls2.index(a))\nfor i in ls1:\n print(i+1)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s623157124', 's965572466', 's617829646'] | [3192.0, 3064.0, 3064.0] | [20.0, 18.0, 19.0] | [362, 386, 364] |
p03774 | u026788530 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['3 4\n10 10\n-10 -10\n3 3\n1 2\n2 3\n3 5\n3 5', 'n,m=[int(_)for _ in input().split()]\n\nab=[[int(_) for _ in input().split()]for i in range(n)]\ncd=[[int(_) for _ in input().split()]for i in range(m)]\n\n\ndef dist(p1,p2):\n return abs(p1[0]-p2[0])+abs(p1[1]-p2[1])\n\nfor i in range(n):\n d=1000000000\n ans=0\n for j in range(m):\n if d>dist(ab[i],cd[j]):\n ans=j+1\n d=dist(ab[i],cd[j])\n print(ans)'] | ['Runtime Error', 'Accepted'] | ['s489649830', 's995371193'] | [2940.0, 3064.0] | [17.0, 19.0] | [37, 356] |
p03774 | u027622859 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['N, M = map(int, input().split())\nab = [input().split() for a in range(M)]\ncd = [input().split() for a in range(M)]\n\n\nfor y in range(M):\n min_p = 999\n point = 1\n for x in range(M):\n distance = abs(int(ab[y][0]) - int(cd[x][0])) + abs(int(ab[y][1]) - int(cd[x][1]))\n if min_p == distance:\n continue\n elif min_p > distance:\n min_p = distance\n point += 1\n print(point)', "N, M = map(int, input().split())\nab = [[int(a) for a in input().split()] for _ in range(N)]\ncd = [[int(a) for a in input().split()] for _ in range(M)]\nfor i in range(N):\n min_distance = float('inf')\n check_point = 0\n for j in range(M):\n manhattan_distance = abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1])\n if min_distance > manhattan_distance:\n min_distance = manhattan_distance\n check_point = j+1\n print(check_point)\n"] | ['Runtime Error', 'Accepted'] | ['s216354850', 's182256322'] | [3064.0, 3064.0] | [21.0, 19.0] | [430, 465] |
p03774 | u046158516 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n,m=map(int,input().split())\na=[]\nb=[]\nfor i in range(n):\n x,y=map(int,input().split())\n a.append(x,y)\nfor i in range(m):\n x,y=map(int,input().split())\n b.append(x,y)\nfor i in a:\n ans=10**18\n t=0\n for j in b:\n if abs(i[0]-j[0])+abs(i[1]-j[1])<ans:\n t=j+1\n ans=abs(i[0]-j[0])+abs(i[1]-j[1])\n print(t)', 'n,m=map(int,input().split())\na=[]\nb=[]\nfor i in range(n):\n x,y=map(int,input().split())\n a.append(x,y)\nfor i in range(m):\n x,y=map(int,input().split())\n b.append(x,y)\nfor i in a:\n ans=10**18\n t=0\n for j in range(m):\n if abs(i[0]-b[j][0])+abs(i[1]-b[j][1])<ans:\n t=j+1\n ans=abs(i[0]-b[j][0])+abs(i[1]-b[j][1])\n print(t)\n', 'n,m=map(int,input().split())\na=[]\nb=[]\nfor i in range(n):\n x,y=map(int,input().split())\n a.append([x,y])\nfor i in range(m):\n x,y=map(int,input().split())\n b.append([x,y])\nfor i in a:\n ans=10**18\n t=0\n for j in range(m):\n if abs(i[0]-b[j][0])+abs(i[1]-b[j][1])<ans:\n t=j+1\n ans=abs(i[0]-b[j][0])+abs(i[1]-b[j][1])\n print(t)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s195187021', 's668050145', 's310891934'] | [3064.0, 3064.0, 3064.0] | [17.0, 18.0, 18.0] | [320, 340, 344] |
p03774 | u049595114 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['N, M = list(map(int, input().split()))\nstudents = list()\ncheckpoints = list()\n\nfor i in range(N):\n\tstudents.append(list(map(int, input().split())))\n\nfor i in range(M):\n\tcheckpoints.append(list(map(int, input().split())))\n\nans = [0] * N\n\nfor i in range(N):\n\tmindif = 4 * 10**8 + 1\n\tfor j in range(M):\n\t\tdif = abs(students[i][0] - checkpoints[j][0]) + abs(students[i][1] - checkpoints[j][1])\n\t\tif dif < mindif:\n\t\t\tmindif = dif\n\t\t\tans[i] = j\n\nfor i in range(M):\n\tprint(ans[i])\n', 'N, M = list(map(int, input().split()))\nstudents = list()\ncheckpoints = list()\n\nfor i in range(N):\n\tstudents.append(list(map(int, input().split())))\n\nfor i in range(M):\n\tcheckpoints.append(list(map(int, input().split())))\n\nans = [0] * N\n\nfor i in range(N):\n\tmindif = 4 * 10**8 + 1\n\tfor j in range(M):\n\t\tdif = abs(students[i][0] - checkpoints[j][0]) + abs(students[i][1] - checkpoints[j][1])\n\t\tif dif < mindif:\n\t\t\tmindif = dif\n\t\t\tans[i] = j + 1\n\nfor i in range(N):\n\tprint(ans[i])\n'] | ['Runtime Error', 'Accepted'] | ['s939023944', 's307011484'] | [3064.0, 3064.0] | [19.0, 19.0] | [474, 478] |
p03774 | u055687574 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['N, M = map(int, input().split())\n\nab = [map(int, input().split()) for _ in range(N)]\ncd = [list(map(int, input().split())) for _ in range(M)]\n\nfor n in range(N):\n ans = []\n a, b = ab[n]\n for m in range(M):\n c, d = cd[m]\n distance = abs(a - c) + abs(b - d)\n ans.append(distance)\n print(ans.index(min(ans)))', 'N, M = map(int, input().split())\n\nab = [map(int, input().split()) for _ in range(N)]\ncd = [list(map(int, input().split())) for _ in range(M)]\n\nfor n in range(N):\n ans = []\n a, b = ab[n]\n for m in range(M):\n c, d = cd[m]\n distance = abs(a - c) + abs(b - d)\n ans.append(distance)\n print(ans.index(min(ans)) + 1)\n'] | ['Wrong Answer', 'Accepted'] | ['s991841641', 's357487728'] | [3064.0, 3064.0] | [18.0, 18.0] | [338, 343] |
p03774 | u059262067 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['A = list(map(int,input().split(" ")))\nH = list()\nC = list()\nresult = list()\nfor i in range(A[0]):\n H.append(list(map(int,input().split(" "))))\nfor i in range(A[1]):\n C.append(list(map(int,input().split(" "))))\n \nfor i in range(A[0]):\n res = 0\n tmp = 99999999\n for ii in range(A[1]):\n if tmp > abs(H[i*2-1] - C[i*2-1]) + abs(H[i*2] - C[i*2]):\n res = ii\n result.append(res)\n\nfor i in range(A[1]):\n print(result[i])\n', 'A = list(map(int,input().split(" ")))\nH = list()\nC = list()\nresult = list()\nfor i in range(A[0]):\n H.append(list(map(int,input().split(" "))))\nfor i in range(A[1]):\n C.append(list(map(int,input().split(" "))))\n\nfor i in range(A[0]):\n res = 0\n tmp = 99999999\n for ii in range(A[1]):\n if tmp > abs(H[i][0] - C[ii][0]) + abs(H[i][1] - C[ii][1]):\n res = ii\n result.append(res)\n\nfor i in range(A[1]):\n print(result[i])\n', 'a = list(map(int,input().split(" ")))\nb = list()\nc = list()\nans = list()\n\nfor i in range(a[0]):\n b.append(list(map(int,input().split(" "))))\n\nfor i in range(a[1]):\n c.append(list(map(int,input().split(" "))))\n\nfor i in range(a[0]):\n d = 0\n e = 99999999\n for ii in range(a[1]):\n if e > abs(b[i][0] - c[ii][0]) + abs(b[i][1] - c[ii][1]):\n e = abs(b[i][0] - c[ii][0]) + abs(b[i][1] - c[ii][1]):\n d = ii\n ans.append(d)\n \nfor i in range(a[0]):\n print(ans[i])\n', 'a = list(map(int,input().split(" ")))\nb = list()\nc = list()\nans = list()\n\nfor i in range(a[0]):\n b.append(list(map(int,input().split(" "))))\n\nfor i in range(a[1]):\n c.append(list(map(int,input().split(" "))))\n\nfor i in range(a[0]):\n d = 0\n e = 99999999\n for ii in range(a[1]):\n if e > abs(b[i][0] - c[ii][0]) + abs(b[i][1] - c[ii][1]):\n d = ii\n ans.append(d)\n \nfor i in range(a[0]):\n print(ans[i])\n', 'a = list(map(int,input().split(" ")))\nb = list()\nc = list()\nans = list()\n\nfor i in range(a[0]):\n b.append(list(map(int,input().split(" "))))\n\nfor i in range(a[1]):\n c.append(list(map(int,input().split(" "))))\n\nfor i in range(a[0]):\n d = 0\n e = 99999999\n for ii in range(a[1]):\n if e > abs(b[i][0] - c[ii][0]) + abs(b[i][1] - c[ii][1]):\n e = abs(b[i][0] - c[ii][0]) + abs(b[i][1] - c[ii][1])\n d = ii\n ans.append(d)\n \nfor i in range(a[0]):\n print(ans[i])\n', 'a = list(map(int,input().split(" ")))\nb = list()\nc = list()\nans = list()\n\nfor i in range(a[0]):\n b.append(list(map(int,input().split(" "))))\n\nfor i in range(a[1]):\n c.append(list(map(int,input().split(" "))))\n\nfor i in range(a[0]):\n d = 0\n e = 9999999999\n for ii in range(a[1]):\n if e > abs(b[i][0] - c[ii][0]) + abs(b[i][1] - c[ii][1]):\n e = abs(b[i][0] - c[ii][0]) + abs(b[i][1] - c[ii][1])\n d = ii\n ans.append(d+1)\n \nfor i in range(a[0]):\n print(ans[i])'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s016380179', 's118124368', 's317377202', 's640409607', 's979807803', 's907912924'] | [3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0] | [17.0, 19.0, 17.0, 19.0, 20.0, 19.0] | [455, 453, 507, 440, 506, 509] |
p03774 | u063073794 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['yandy\nn, m = map(int, input().split())\n\nstudent = []\n\nfor i in range(n):\n a, b = map(int, input().split())\n student.append((a, b))\n\npoint = []\n\nfor j in range(m):\n c, d = map(int, input().split())\n point.append((c, d))\n\nfor a, b in student:\n length = 10 ** 10\n pn = 0\n for j in range(m):\n c, d = point[j]\n if abs(a-c) + abs(b-d) < length:\n length = abs(a-c) + abs(b-d)\n pn = j + 1\n print(pn)\n', 'n,m=map(int,input().split())\nstudent=[list(map(int,input().split())) for i in range(n)]\npoint=[list(map(int,input().split())) for i in range(m)]\n\nfor a,b in student:\n length=10**10\n pn=0\n for j in range(m):\n c,d=point[j]\n if abs(a-c)+abs(b-d)<length:\n length=abs(a-c)+abs(b-d)\n pn=1+j\n print(pn)'] | ['Runtime Error', 'Accepted'] | ['s707128424', 's347007478'] | [3064.0, 3064.0] | [17.0, 18.0] | [452, 315] |
p03774 | u072606168 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ["n,m=map(int,input())\na,b,c,d=[],[],[],[]\nfor i in range(n):\n o = list(map(int, input().split()))\n a.append(o[0])\n b.append(o[1])\nfor i in range(m):\n o = list(map(int, input().split()))\n c.append(o[0])\n d.append(o[1])\ns = []\nfor i in range(n):\n g = float('inf')\n h = 0\n for j in range(m):\n if g > abs(a[i]-c[j])+abs(b[i]-d[j]):\n g = abs(a[i]-c[j])+abs(b[i]-d[j])\n h = j+1\n s.append(h)\nfor i in s:\n print(i)", "n,m=map(int,input().split())\na,b,c,d=[],[],[],[]\nfor i in range(n):\n o = list(map(int, input().split()))\n a.append(o[0])\n b.append(o[1])\nfor i in range(m):\n o = list(map(int, input().split()))\n c.append(o[0])\n d.append(o[1])\ns = []\nfor i in range(n):\n g = float('inf')\n h = 0\n for j in range(m):\n if g > abs(a[i]-c[j])+abs(b[i]-d[j]):\n g = abs(a[i]-c[j])+abs(b[i]-d[j])\n h = j+1\n s.append(h)\nfor i in s:\n print(i)"] | ['Runtime Error', 'Accepted'] | ['s572655960', 's313326771'] | [3064.0, 3064.0] | [18.0, 18.0] | [429, 475] |
p03774 | u072717685 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n, m = map(int,input().split())\nstudents = [None]*n\npoints = [None]*m\nfor i in range(n):\n students[i] = tuple(map(int,input().split()))\nfor i in range(m):\n points[i] = tuple(map(int,input().split()))\n\nans = [None]*n\nfor s in students:\n tmp = [None]*m\n for p in points:\n tmp[p] = abs(students[s][0] - points[p][0]) + abs(students[s][1] - points[p][1])\n ans[s] = tmp.index(min(tmp))\nfor i in range(n):\n print(ans[i])\n', 'n, m = map(int,input().split())\nstudents = [None]*n\npoints = [None]*m\nfor i in range(n):\n students[i] = tuple(map(int,input().split()))\nfor i in range(m):\n points[i] = tuple(map(int,input().split()))\n\nans = []\nfor s in students:\n tmp = []\n for p in points:\n tmp.append(abs(s[0] - p[0]) + abs(s[1] - p[1]))\n ans.append(tmp.index(min(tmp)) + 1)\nfor i in range(n):\n print(ans[i])'] | ['Runtime Error', 'Accepted'] | ['s825082334', 's060489689'] | [3064.0, 3064.0] | [17.0, 19.0] | [424, 385] |
p03774 | u074220993 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ["N, M = map(int, input().split())\nstudent = [tuple(map(int, input().split())) for _ in range(N)]\ncheckpoint = [tuple(map(int, input().split())) for _ in range(M)]\n\nclosest = {}\nfor s in student:\n min_dist = 'INF'\n ans = 1\n for c in checkpoint:\n dist = abs(s[0]-c[0]) + abs(s[1]-c[1])\n if min_dist == 'INF' or dist < min_dist:\n min_dist = dist\n closest[s] = ans\n ans += 1\n\nprint(closest[s] for s in student)\n ", 'N, M = map(int, input().split())\nStd = [tuple(map(int, input().split())) for _ in range(N)]\nChp = [tuple(map(int, input().split())) for _ in range(M)]\nINF = 10e9\nArrv = []\nMdist = lambda x,y,u,v:abs(x-u)+abs(y-v)\nfor s in Std:\n close = INF\n for i in range(M):\n dist = Mdist(*s,*Chp[i])\n if dist < close:\n close = dist\n arrv = i+1\n Arrv.append(arrv)\nfor ar in Arrv:\n print(ar) '] | ['Wrong Answer', 'Accepted'] | ['s122120351', 's881294603'] | [9196.0, 9156.0] | [26.0, 28.0] | [470, 427] |
p03774 | u075012704 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['# B-Checkpoints\n\n\nN, M = map(int, input().split()) \nABs = [] \nCDs = [] \n\n\nfor i in range(N):\n ABs.append([int(x) for x in input().split()])\n\n\nfor i in range(N):\n CDs.append([int(x) for x in input().split()])\n\nfor a,b in ABs:\n \n distance = [abs(a-c) + abs(b-d) for c,d in CDs]\n print(distance)\n \n \n \n print(distance.index(min(distance)) + 1)\n', '# B-Checkpoints\n\n\nN, M = map(int, input().split()) \nABs = [] \nCDs = [] \n\n\nfor i in range(N):\n ABs.append([int(x) for x in input().split()])\n\n\nfor i in range(M):\n CDs.append([int(x) for x in input().split()])\n\nfor a,b in ABs:\n \n distance = [abs(a-c) + abs(b-d) for c,d in CDs]\n \n \n \n print(distance.index(min(distance)) + 1)'] | ['Runtime Error', 'Accepted'] | ['s175880012', 's543700506'] | [3060.0, 3064.0] | [19.0, 19.0] | [1006, 985] |
p03774 | u078276601 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n,m=map(int,input().split())\nab=[list(map(int, input().split())) for i in range(n)]\ncd=[list(map(int, input().split())) for j in range(m)]\n\nfor i in range(n):\n l=[]\n for j in range(m):\n dist=abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1])\n l.append(dist)\n print(l)\n goal = l.index(min(l))+1\n print(goal)', 'n,m=map(int,input().split())\nab=[list(map(int, input().split())) for i in range(n)]\ncd=[list(map(int, input().split())) for j in range(m)]\n\nfor i in range(n):\n l=[]\n for j in range(m):\n dist=abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1])\n l.append(dist)\n goal = l.index(min(l))+1\n print(goal)'] | ['Wrong Answer', 'Accepted'] | ['s568114372', 's236461835'] | [9172.0, 9000.0] | [32.0, 27.0] | [330, 317] |
p03774 | u088488125 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n,m=map(int, input().split())\na_list=[]\nb_list=[]\nfor i in range(n):\n a,b=map(int, input().split())\n a_list.append(a)\n b_list.append(b)\nc_list=[]\nd_list=[]\nfor i in range(m):\n c,d=map(int, input().split())\n c_list.append(c)\n d_list.append(d)\nfor i in range(n):\n min=0\n min_number=0\n for j in range(m):\n d=abs(a[i]-c[j])+abs(b[i]-d[j])\n if d<min:\n min=d\n min_number=j\n print(min_number)', 'n,m=map(int, input().split())\na_list=[]\nb_list=[]\nfor i in range(n):\n a,b=map(int, input().split())\n a_list.append(a)\n b_list.append(b)\nc_list=[]\nd_list=[]\nfor i in range(m):\n c,d=map(int, input().split())\n c_list.append(c)\n d_list.append(d)\nfor i in range(n):\n min=2*(10**8)\n min_number=0\n for j in range(m):\n d=abs(a_list[i]-c_list[j])+abs(b_list[i]-d_list[j])\n if d<min:\n min=d\n min_number=j\n print(min_number+1)\n'] | ['Runtime Error', 'Accepted'] | ['s493281029', 's531420634'] | [9148.0, 9160.0] | [24.0, 31.0] | [411, 442] |
p03774 | u094565093 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['N,M=map(int,input().split())\nS=[list(map(int,input().split())) for i in range(N)]\nT=[list(map(int,input().split())) for i in range(M)]\nfor i in range(N):\n x1=S[i][0]\n y1=S[i][1]\n x2=T[0][0]\n y2=T[0][1]\n min=abs(x1-x2)+abs(y1-y2)\n x1=S[i][0]\n y1=S[i][1]\n for j in range(M-1,-1,-1):\n x2=T[j][0]\n y2=T[j][1]\n if min>=abs(x1-x2)+abs(y1-y2):\n min=abs(x1-x2)+abs(y1-y2)\n R[i]=j+1\nfor i in range(len(R)):\n print(R[i])', 'N,M=map(int,input().split())\na=[list(map(int,input().split())) for i in range(N)]\nb=[list(map(int,input().split())) for i in range(M)]\nfor i in range(N):\n dmin=abs(a[i][0]-b[0][0])+abs(a[i][1]-b[0][1])\n num=1\n for j in range(M):\n dist=abs(a[i][0]-b[j][0])+abs(a[i][1]-b[j][1])\n if dmin>dist:\n dmin=dist\n num=j+1\n print(num) '] | ['Runtime Error', 'Accepted'] | ['s093015656', 's664869268'] | [3064.0, 3064.0] | [18.0, 19.0] | [480, 373] |
p03774 | u099566485 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ["n,m=map(int,input().split())\ns=[]\np=[]\nmd=[[None,float('INF')] for i in range(n)]\nfor i in range(n):\n t1,t2=map(int,input().split())\n s.append([t1,t2])\nfor i in range(m):\n t1,t2=map(int,input().split())\n p.append([t1,t2])\nfor i in range(n):\n for j in range(m):\n if md[i][1]>abs(s[i][0]-p[j][0])+abs(s[i][1]-p[j][1]):\n md[i][0]=j+1\nfor i in range(n):\n print(md[i][0])", "n,m=map(int,input().split())\ns=[]\np=[]\nmd=[[None,float('INF')] for i in range(n)]\nfor i in range(n):\n t1,t2=map(int,input().split())\n s.append([t1,t2])\nfor i in range(m):\n t1,t2=map(int,input().split())\n p.append([t1,t2])\nfor i in range(n):\n for j in range(m):\n if md[i][1]>abs(s[i][0]-p[j][0])+abs(s[i][1]-p[j][1]):\n md[i][0]=j+1\n md[i][1]=abs(s[i][0]-p[j][0])+abs(s[i][1]-p[j][1])\nfor i in range(n):\n print(md[i][0])"] | ['Wrong Answer', 'Accepted'] | ['s703895374', 's572012056'] | [3064.0, 3064.0] | [19.0, 19.0] | [402, 465] |
p03774 | u103099441 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n, m = map(int, input().split())\ns = []\nd = []\nfor i in range(n):\n x, y = map(int, input().split())\n s.append([x, y])\nfor i in range(m):\n x, y = map(int, input().split())\n d.append([x, y])\nfor i in s:\n a = m\n c = abs(i[0] - x) + abs(i[1] - y)\n for j in range(m):\n c_t = abs(i[0] - d[j][0]) + abs(i[1] - d[j][1])\n if c_t < c:\n c = min(c, c_t)\n a = j\n print(a)', 'n, m = map(int, input().split())\ns = []\nd = []\nfor i in range(n):\n x, y = map(int, input().split())\n s.append([x, y])\nfor i in range(m):\n x, y = map(int, input().split())\n d.append([x, y])\nfor i in s:\n a = m\n c = abs(i[0] - d[0][0]) + abs(i[1] - d[0][1])\n for j in range(1, m):\n c_t = abs(i[0] - d[j][0]) + abs(i[1] - d[j][1])\n if c_t < c:\n c = min(c, c_t)\n a = j\n print(a)\n', 'n, m = map(int, input().split())\ns = []\nd = []\nfor i in range(n):\n x, y = map(int, input().split())\n s.append([x, y])\nfor i in range(m):\n x, y = map(int, input().split())\n d.append([x, y])\nfor i in s:\n a = m\n c = abs(i[0] - x) + abs(i[1] - y)\n for j in range(m):\n c_t = abs(i[0] - d[j][0]) + abs(i[1] - d[j][1])\n if c_t < c:\n c = min(c, c_t)\n a = j\n print(a)', 'n, m = map(int, input().split())\ns = []\nd = []\nfor i in range(n):\n x, y = map(int, input().split())\n s.append([x, y])\nfor i in range(m):\n x, y = map(int, input().split())\n d.append([x, y])\nfor i in s:\n a = 1\n c = abs(i[0] - d[0][0]) + abs(i[1] - d[0][1])\n for j in range(1, m):\n c_t = abs(i[0] - d[j][0]) + abs(i[1] - d[j][1])\n if c_t < c:\n c = min(c, c_t)\n a = j + 1\n print(a)\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s011231796', 's594563399', 's919827927', 's650706556'] | [3064.0, 3064.0, 3064.0, 3064.0] | [18.0, 19.0, 19.0, 18.0] | [418, 434, 418, 438] |
p03774 | u103902792 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ["n,m = map(int,input().split())\nstds = [tuple(map(int,input().split())) for _ in range(n)]\npoints = [tuple(map(int,input().split())) for _ in range(m)]\n\ndef d(s,p):\n return abs(s[0]-p[0]) + abs(s[1] + p[1])\n\nfor std in stds:\n ans = (float('inf'), -1)\n for i, pnt in enumerate(points):\n if d(std,pnt) < ans[1]:\n ans = (i, pnt)\n print(i+1)", "n,m = map(int,input().split())\nstds = [tuple(map(int,input().split())) for _ in range(n)]\npoints = [tuple(map(int,input().split())) for _ in range(m)]\n\ndef d(s,p):\n return abs(s[0]-p[0]) + abs(s[1] - p[1])\n\nfor std in stds:\n ans = (-1, float('inf'))\n for i, pnt in enumerate(points):\n dst = d(std,pnt)\n if dst < ans[1]:\n ans = (i, dst)\n print(ans[0]+1)\n\n"] | ['Wrong Answer', 'Accepted'] | ['s673551883', 's397447137'] | [3064.0, 3064.0] | [18.0, 19.0] | [348, 369] |
p03774 | u105124953 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n, m = map(int,input().split())\nstudent_list = [list(map(int,input().split())) for _ in range(n)]\nprint(student_list)\ncheck_list = [list(map(int,input().split())) for _ in range(m)]\nprint(check_list)\nfor s in student_list:\n tmp = []\n for c in check_list:\n tmp.append(abs(s[0]-c[0]) + abs(s[1]-c[1]))\n print(tmp.index(min(tmp))+1)', 'n, m = map(int,input().split())\nstudent_list = [list(map(int,input().split())) for _ in range(n)]\n\ncheck_list = [list(map(int,input().split())) for _ in range(m)]\n\nfor s in student_list:\n tmp = []\n for c in check_list:\n tmp.append(abs(s[0]-c[0]) + abs(s[1]-c[1]))\n print(tmp.index(min(tmp))+1)'] | ['Wrong Answer', 'Accepted'] | ['s930250022', 's268475374'] | [3064.0, 3064.0] | [18.0, 19.0] | [345, 309] |
p03774 | u112902287 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n, m = map(int, input().split())\npos = []\nche = []\nfor i in range(n):\n a,b=map(int,input().split())\n pos.append([a,b])\nfor i in range(m):\n a,b=map(int,input().split())\n che.append([a,b])\n\nfor i in range(n):\n dis = []\n for j in range(m):\n dis.append(abs(pos[i][0]-che[i][0])+abs(pos[i][1]-che[i][1]))\n print(dis.index(min(dis))+1)', 'n, m = map(int, input().split())\nprint(n,m)\npos = []\nche = []\nfor i in range(n):\n a,b=map(int,input().split())\n pos.append([a,b])\nfor i in range(m):\n a,b=map(int,input().split())\n che.append([a,b])\n\nfor i in range(n):\n dis = []\n for j in range(m):\n dis.append(abs(pos[i][0]-che[i][0])+abs(pos[i][1]-che[i][1]))\n print(dis.index(min(dis))+1)', 'n, m = map(int, input().split())\npos = []\nche = []\nfor i in range(n):\n a, b = map(int,input().split())\n pos.append([a,b])\nfor i in range(m):\n a, b = map(int,input().split())\n che.append([a,b])\n \nfor i in range(n):\n dis = []\n for j in range(m):\n dis.append(abs(pos[i][0]-che[j][0])+abs(pos[i][1]-che[j][1]))\n print(dis.index(min(dis))+1)\n\n\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s323614359', 's783946274', 's722895873'] | [3064.0, 3064.0, 3064.0] | [18.0, 19.0, 18.0] | [357, 368, 367] |
p03774 | u121698457 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['N, M = map(int,input().split())\nst = [[] for _ in range(N)]\ncp = [[] for _ in range(M)]\nfor i in range(N):\n a, b = map(int,input().split())\n st[i] = [a, b]\nfor j in range(M):\n c, d = map(int,input().split())\n cp[j] = [c, d]\nfor i in range(N):\n ne = 10**12\n p = 0\n for j in range(M):\n dis = abs(st[i][0]-cp[j][0])+abs(st[i][1]-cp[j][1])\n print(dis)\n if dis < ne:\n p = j\n ne = dis\n print(p)\n print(p+1)', 'N, M = map(int,input().split())\nst = [[] for _ in range(N)]\ncp = [[] for _ in range(M)]\nfor i in range(N):\n a, b = map(int,input().split())\n st[i] = [a, b]\nfor j in range(M):\n c, d = map(int,input().split())\n cp[j] = [c, d]\nfor i in range(N):\n ne = 10**12\n p = 0\n for j in range(M):\n dis = abs(st[i][0]-cp[j][0])+abs(st[i][1]-cp[j][1])\n if dis < ne:\n p = j\n ne = dis\n print(p+1)'] | ['Wrong Answer', 'Accepted'] | ['s293827600', 's682052928'] | [3316.0, 3064.0] | [23.0, 19.0] | [474, 438] |
p03774 | u124323472 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n, m = list(map(int, input().split()))\n\na = []\nb = []\n\nfor i in range(n):\n tmp1, tmp2 = list(map(int, input().split()))\n a.append(tmp1)\n b.append(tmp2)\n\nc = []\nd = []\n\nfor i in range(m):\n tmp1, tmp2 = list(map(int, input().split()))\n c.append(tmp1)\n d.append(tmp2)\n\nfor i in range(n):\n tmp = abs(a[n] - c[0]) + abs(b[n] - d[0])\n s = 1\n for j in range(m):\n tmp3 = abs(a[i] - c[j]) + abs(b[i] - d[j])\n if tmp3 < tmp:\n tmp = tmp3\n s = j + 1\n print(s)', 'n, m = list(map(int, input().split()))\n\na = []\nb = []\n\nfor i in range(n):\n tmp1, tmp2 = list(map(int, input().split()))\n a.append(tmp1)\n b.append(tmp2)\n\nc = []\nd = []\n\nfor i in range(m):\n tmp1, tmp2 = list(map(int, input().split()))\n c.append(tmp1)\n d.append(tmp2)\n\nfor i in range(n):\n tmp = abs(a[i] - c[0]) + abs(b[i] - d[0])\n s = 1\n for j in range(m):\n tmp3 = abs(a[i] - c[j]) + abs(b[i] - d[j])\n if tmp3 < tmp:\n tmp = tmp3\n s = j + 1\n print(s)'] | ['Runtime Error', 'Accepted'] | ['s790416813', 's665554097'] | [3064.0, 3064.0] | [18.0, 19.0] | [513, 513] |
p03774 | u131264627 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n, m = map(int, input().split())\nab = [list(map(int, input().split())) for _ in range(n)]\ncd = [list(map(int, input().split())) for _ in range(m)]\nprint(ab)\nprint(cd)\nfor i in range(n):\n seq_min = 1e9\n ans = -1\n for j in range(m):\n seq = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1])\n if seq_min > seq:\n seq_min = seq\n ans = j\n print(ans + 1)', 'n, m = map(int, input().split())\nab = [list(map(int, input().split())) for _ in range(n)]\ncd = [list(map(int, input().split())) for _ in range(m)]\nfor i in range(n):\n seq_min = 1e9\n ans = -1\n for j in range(m):\n seq = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1])\n if seq_min > seq:\n seq_min = seq\n ans = j\n print(ans + 1)\n'] | ['Wrong Answer', 'Accepted'] | ['s261599617', 's954723812'] | [3064.0, 3064.0] | [19.0, 19.0] | [396, 377] |
p03774 | u136395536 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['N,M = (int(i) for i in input().split())\n\n\nstudent = []\nfor i in range(N):\n a,b = (int(i) for i in input().split())\n student.append([a,b])\n\npoint = []\nfor j in range(M):\n c,d = (int(i) for i in input().split())\n point.append([c,d])\n\nminimum = N*[""]\nnumber = N*[0]\n\n\n\nfor i in range(N):\n minimum[i] = abs(student[i][0]-point[0][0]) + abs(student[i][1]-point[0][1])\n for j in range(M):\n distance = abs(student[i][0]-point[j][0]) + abs(student[i][1]-point[j][1])\n if distance<= minimum[i]:\n number[i] = j+1\n minimum[i] = min(distance,minimum[i])\n\nfor i in range(N):\n\tprint(number[i])\n', 'N,M = (int(i) for i in input().split())\n\nstudent = []\nfor i in range(N):\n a,b = (int(k) for k in input().split())\n student.append([a,b])\n\npoints = []\nfor i in range(M):\n c,d = (int(k) for k in input().split())\n points.append([a,b])\n \ndistance = []\nkyori = []\n\n\nfor i in range(N):\n for j in range(1):\n kyori.append(abs(student[i][0]-points[j][0]) + abs(student[i][1]-points[j][1]))\n distance.append(min(kyori[j]))\n\nfor i in range(N):\n for j in range(1,M):\n kyori[j] = abs(student[i][0]-points[j][0]) + abs(student[i][1]-points[j][1])\n distance.append(min(kyori[j]))\n\nfor i in range(N):\n print(distance[i])', "N,M = (int(i) for i in input().split())\n\nstudent = []\nfor i in range(N):\n a,b = (int(k) for k in input().split())\n student.append([a,b])\n\npoints = []\nfor i in range(M):\n c,d = (int(k) for k in input().split())\n points.append([a,b])\n \ndistance = []\nkyori = []\n\n'''\nfor i in range(N):\n for j in range(1):\n kyori.append(abs(student[i][0]-points[j][0]) + abs(student[i][1]-points[j][1]))\n distance.append(min(kyori))\n\nfor i in range(N):\n for j in range(1,M):\n kyori[j] = abs(student[i][0]-points[j][0]) + abs(student[i][1]-points[j][1])\n distance.append(min(kyori))\n'''\n\nfor i in range(1):\n for j in range(M):\n kyori.append(abs(student[i][0]-points[j][0]) + abs(student[i][1]-points[j][1]))\n print(kyori)\n distance.append(min(kyori))\n\nfor i in range(1,N):\n for j in range(M):\n kyori[j] = abs(student[i][0]-points[j][0]) + abs(student[i][1]-points[j][1])\n print(kyori)\n distance.append(min(kyori))\n\nfor i in range(N):\n print(distance[i])", 'N,M = (int(i) for i in input().split())\na=[]\nb=[]\nc=[]\nd=[]\n\nfor i in range(N):\n A,B = (int(i) for i in input().split())\n a.append(A)\n b.append(B)\n\nfor i in range(M):\n C,D = (int(i) for i in input().split())\n c.append(C)\n d.append(D)\n\n\nclosest = N*[0]\n\nfor i in range(N):\n minimum = abs(a[i]-c[0])+abs(b[i]-d[0])\n number = 1\n for j in range(1,M):\n distance = abs(a[i]-c[j])+abs(b[i]-d[j])\n if distance < minimum:\n minimum = distance\n number = j+1\n closest[i] = number\n\nfor i in range(N):\n print(closest[i])'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s386724235', 's443443502', 's645268043', 's069057253'] | [3064.0, 3064.0, 4340.0, 3064.0] | [20.0, 18.0, 36.0, 19.0] | [631, 648, 1016, 575] |
p03774 | u137228327 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['N,M = map(int,input().split())\nstudent = [list(map(int,input().split())) for _ in range(N)]\ncpoint = [list(map(int,input().split())) for _ in range(M)]\nfor i in range(N):\n mannmn = 10**8\n for j in range(M):\n mann = abs(student[i][0] - cpoint[j][0])+abs(student[i][1] - cpoint[j][1])\n if mann <= mannmn:\n mannmn = mann\n ref = j\n print(ref+1)', 'N,M = map(int,input().split())\nstudent = [list(map(int,input().split())) for _ in range(N)]\ncpoint = [list(map(int,input().split())) for _ in range(M)]\nfor i in range(N):\n mannmn = 10**10\n mann = 10**10\n for j in range(M):\n mann = abs(student[i][0] - cpoint[j][0])+abs(student[i][1] - cpoint[j][1])\n if mann < mannmn:\n mannmn = mann\n ref = j\n print(ref+1)\n '] | ['Runtime Error', 'Accepted'] | ['s580550393', 's126387353'] | [9132.0, 9044.0] | [27.0, 28.0] | [385, 412] |
p03774 | u143903328 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['m,n = map(int,input().split())\nstudent = []\ncheckpoint = []\nfor i in range(n):\n student.append(list(map(int,input().split())))\nfor i in range(m):\n checkpoint.append(list(map(int,input().split())))\n\nfor i in range(m):\n ans = 0 \n tmp = 10000000000000\n for j in range(m):\n if tmp < abs(student[i][0] - checkpoint[i][0]) + abs(student[i][1] - checkpoint[i][1]):\n ans = i\n tmp = abs(student[i][0] - checkpoint[i][0]) + abs(student[i][1] - checkpoint[i][1])\n print(ans+1)\n\n', '\nm,n = map(int,input().split())\nstudent = []\ncheckpoint = []\nfor i in range(m):\n student.append(list(map(int,input().split())))\nfor i in range(n):\n checkpoint.append(list(map(int,input().split())))\n\nfor i in range(m):\n ans = 0 \n tmp = 1000000000\n for j in range(n):\n if tmp > abs(student[i][0] - checkpoint[i][0]) + abs(student[i][1] - checkpoint[i][1]):\n ans = i\n tmp = abs(student[i][0] - checkpoint[i][0]) + abs(student[i][1] - checkpoint[i][1])\n print(ans+1)\n', '\nm,n = map(int,input().split())\nstudent = []\ncheckpoint = []\nfor i in range(n):\n student.append(list(map(int,input().split())))\nfor i in range(m):\n checkpoint.append(list(map(int,input().split())))\n\nfor i in range(m):\n ans = 0 \n tmp = 10000000000000\n for j in range(n):\n if tmp > abs(student[i][0] - checkpoint[i][0]) + abs(student[i][1] - checkpoint[i][1]):\n ans = i\n tmp = abs(student[i][0] - checkpoint[i][0]) + abs(student[i][1] - checkpoint[i][1])\n print(ans+1)\n', 'm,n = map(int,input().split())\nstudent = []\ncheckpoint = []\nfor i in range(n):\n student.append(list(map(int,input().split())))\nfor i in range(m):\n checkpoint.append(list(map(int,input().split())))\n\nfor i in range(m):\n ans = 0 \n tmp = 10000000000000\n for j in range(m):\n if tmp > abs(student[i][0] - checkpoint[i][0]) + abs(student[i][1] - checkpoint[i][1]):\n ans = i\n tmp = abs(student[i][0] - checkpoint[i][0]) + abs(student[i][1] - checkpoint[i][1])\n print(ans+1)', 'n,m = map(int,input().split())\nstudent = []\ncheckpoint = []\nfor i in range(n):\n student.append(list(map(int,input().split())))\nfor i in range(m):\n checkpoint.append(list(map(int,input().split())))\n\nfor i in range(n):\n ans = 0 \n tmp = 100000000000 \n for j in range(m):\n if tmp > abs(student[i][0] - checkpoint[j][0]) + abs(student[i][1] - checkpoint[j][1]):\n ans = j\n tmp = abs(student[i][0] - checkpoint[j][0]) + abs(student[i][1] - checkpoint[j][1])\n print(ans+1)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s321228532', 's489182019', 's544772130', 's576559856', 's428478183'] | [3064.0, 3064.0, 3064.0, 3064.0, 3064.0] | [19.0, 18.0, 19.0, 18.0, 19.0] | [567, 563, 567, 565, 580] |
p03774 | u146575240 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['# B - Checkpoints\nN, M = list(map(int, input().split()))\nP = [list(map(int, input().split())) for i in range(N)]\nC = [list(map(int, input().split())) for i in range(M)]\n\nans = [1]*N\nfor i in range(N): \n D = [10 ** 10] * M\n for j in range(M): \n D[j] = abs(P[i][0]-C[j][0]) + abs(P[i][1]-C[j][1])\n if D[j] <= min(D):\n if ans[i] >= j+1:\n pass\n else:\n ans[i] = j+1\n else:\n pass\n\nfor i in range(N):\n print(ans[i])', '# B - Checkpoints\nN, M = list(map(int, input().split()))\nP = [list(map(int, input().split())) for i in range(N)]\nC = [list(map(int, input().split())) for i in range(M)]\n\nans = [0] * N\nfor i in range(N): \n D = [10 ** 10] * M\n D_hikaku = 10 ** 10\n for j in range(M): \n\n D = abs(P[i][0]-C[j][0]) + abs(P[i][1]-C[j][1])\n if D < D_hikaku:\n D_hikaku = D\n ans[i] = j + 1\n else:\n pass\n\nfor i in range(N):\n print(ans[i])'] | ['Wrong Answer', 'Accepted'] | ['s221703967', 's505037042'] | [3064.0, 3064.0] | [22.0, 19.0] | [546, 522] |
p03774 | u163320134 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n,m=map(int,input().split())\npos1=[list(map(int,input().split())) for _ in range(n)]\npos2=[list(map(int,input().split())) for _ in range(m)]\nans=[0]*n\nfor i in range(n):\n lim=10**9\n for j in range(m):\n tmp=abs(pos1[i][0]-pos2[i][0])+abs(pos1[i][1]-pos2[i][1])\n if tmp<lim:\n tmp=lim\n ans[i]=j\nfor i in range(n):\n print(ans[i])', 'n,m=map(int,input().split())\npos1=[list(map(int,input().split())) for _ in range(n)]\npos2=[list(map(int,input().split())) for _ in range(m)]\nans=[0]*n\nfor i in range(n):\n lim=10**9\n for j in range(m):\n tmp=abs(pos1[i][0]-pos2[j][0])+abs(pos1[i][1]-pos2[j][1])\n if tmp<lim:\n lim=tmp\n ans[i]=j+1\nfor i in range(n):\n print(ans[i])'] | ['Runtime Error', 'Accepted'] | ['s087257527', 's310514021'] | [3064.0, 3064.0] | [19.0, 19.0] | [344, 346] |
p03774 | u166696759 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n, m = map(int, input().split())\nA = [(a, b) for a, b in map(int, input().split())]\nC = [(c, d) for c, d in map(int, input().split())]\nfor i in range(n):\n res = 0\n ans = 1 << 20\n for j in range(m):\n tmp = abs(A[i][0] - C[j][0]) + abs(A[i][1] - C[j][1]) )\n if tmp < ans:\n\t ans = tmp\n res = j\n print(j)\n', 'n, m = map(int, input().split())\nA = [tuple(map(int, input().split())) for i in range(n)]\nC = [tuple(map(int, input().split())) for j in range(m)]\nfor i in range(n):\n res = 1 \n ans = abs(A[i][0] - C[0][0]) + abs(A[i][1] - C[0][1])\n for j in range(m):\n tmp = abs(A[i][0] - C[j][0]) + abs(A[i][1] - C[j][1])\n if tmp < ans:\n ans = tmp\n res = j+1\n print(res)\n'] | ['Runtime Error', 'Accepted'] | ['s697547736', 's409364684'] | [3060.0, 3064.0] | [18.0, 19.0] | [317, 375] |
p03774 | u168416324 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n,m=map(int,input().split())\nst=[]\nch=[]\ndef mht(ax,ay,bx,by):\n return abs(ax-bx)+abs(ay-by)\n\nfor i in range(n):\n st.append(list(map(int,input().split())))\nfor i in range(m):\n ch.append(list(map(int,input().split())))\n \nfor i in st:\n ax=i[0]\n ay=i[1]\n mn=100000000\n for (j,k) in zip(ch,range(len(ch))):\n bx=j[0]\n by=j[1]\n mh=mht(ax,ay,bx,by)\n if mh<mn:\n mn=mh\n nm=k\n print(nm)\n', 'n,m=map(int,input().split())\nst=[]\nch=[]\ndef mht(ax,ay,bx,by):\n return abs(ax-bx)+abs(ay-by)\n\nfor i in range(n):\n st.append(list(map(int,input().split())))\nfor i in range(m):\n ch.append(list(map(int,input().split())))\n \nfor i in st:\n ax=i[0]\n ay=i[1]\n mn=100000000\n for (j,k) in zip(ch,len(ch)):\n bx=j[0]\n by=j[1]\n mh=mht(ax,ay,bx,by)\n if mh<mn:\n mn=mh\n nm=k\n print(nm)\n', 'n,m=map(int,input().split())\nst=[]\nch=[]\ndef mht(ax,ay,bx,by):\n return abs(ax-bx)+abs(ay-by)\n\nfor i in range(n):\n st.append(list(map(int,input().split())))\nfor i in range(m):\n ch.append(list(map(int,input().split())))\n \nfor i in st:\n ax=i[0]\n ay=i[1]\n mn=1000000000\n for (j,k) in zip(ch,range(len(ch))):\n bx=j[0]\n by=j[1]\n mh=mht(ax,ay,bx,by)\n if mh<mn:\n mn=mh\n nm=k\n print(nm+1)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s449785097', 's925381918', 's445735144'] | [9064.0, 9212.0, 9220.0] | [22.0, 25.0, 27.0] | [408, 401, 411] |
p03774 | u185896732 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['import sys\ninput=sys.stdin.readline\n\nn,m=map(int,input().split())\ng=[list(map(int,input().split())) for _ in range(n)]\nc=[list(map(int,input().split())) for _ in range(m)]\n\nfor i in g:\n a,b=i[0],i[1]\n dis=10**10\n ind=1\n for j in range(m):\n x,y=c[j][0],c[j][1]\n now=abs(a-x)+abs(b-y)\n if now<dis:\n dis=now\n ind=j+1\n print(ind)import sys\ninput=sys.stdin.readline\n\nn,m=map(int,input().split())\ng=[list(map(int,input().split())) for _ in range(n)]\nc=[list(map(int,input().split())) for _ in range(m)]\n\nfor i in g:\n a,b=i[0],i[1]\n dis=10**10\n ind=1\n for j in range(m):\n x,y=c[j][0],c[j][1]\n now=abs(a-x)+abs(b-y)\n if now<dis:\n dis=now\n ind=j+1\n print(ind)', 'import sys\ninput=sys.stdin.readline\n\nn,m=map(int,input().split())\ng=[list(map(int,input().split())) for _ in range(n)]\nc=[list(map(int,input().split())) for _ in range(m)]\n\nfor i in g:\n a,b=i[0],i[1]\n dis=10**10\n ind=1\n for j in range(m):\n x,y=c[j][0],c[j][1]\n now=abs(a-x)+abs(b-y)\n if now<dis:\n dis=now\n ind=j+1\n print(ind)'] | ['Runtime Error', 'Accepted'] | ['s509686081', 's475942861'] | [3064.0, 3064.0] | [17.0, 19.0] | [766, 383] |
p03774 | u209619667 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['a,b = map(int,input().split())\nS = [list(map(int,input().split())) for i in range(a)]\nCP = [list(map(int,input().split())) for i in range(b)]\nfor s in S:\n count = 0\n ab = 10**8\n p = 10**8\n for cp in CP:\n total = abs(s[0]-cp[0]) + abs(s[1]-cp[1])\n count +=1\n print(cp)\n if ab > total:\n ab = total\n p = count\n \n print(p)', 'a,b = map(int,input().split())\nS = [list(map(int,input().split())) for i in range(a)]\nCP = [list(map(int,input().split())) for i in range(b)]\nfor s in S:\n count = 0\n ab = 10**9\n p = 10**9\n for i,cp in zip(range(b),CP):\n total = abs(s[0]-cp[0]) + abs(s[1]-cp[1])\n count +=1\n if ab > total:\n ab = total\n p = i+1\n \n print(p)'] | ['Wrong Answer', 'Accepted'] | ['s498916807', 's624127308'] | [3188.0, 3064.0] | [21.0, 19.0] | [350, 350] |
p03774 | u220345792 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['N, M = map(int, input().split())\nstu = []\nche = []\nfor i in range(N):\n stu.append(list(map(int, input().split())))\nfor i in range(M):\n che.append(list(map(int, input().split())))\n \nfor i in stu:\n x, y = i[0], i[1]\n ans = 0\n tmp = 99999999999999\n for j in che:\n if abs(x-j[0])+abs(y-j[1]) < tmp:\n tmp = abs(x-j[0])+abs(y-j[1])\n ans = j + 1\n print(ans)', 'N, M = map(int, input().split())\nstu = []\nche = []\nfor i in range(N):\n stu.append(list(map(int, input().split())))\nfor i in range(M):\n che.append(list(map(int, input().split())))\n \nfor i in stu:\n x, y = i[0], i[1]\n ans = 0\n tmp = 99999999999999\n for num, j in enumerate(che):\n if abs(x-j[0])+abs(y-j[1]) < tmp:\n tmp = abs(x-j[0])+abs(y-j[1])\n ans = num + 1\n print(ans)\n\n'] | ['Runtime Error', 'Accepted'] | ['s536440897', 's062330206'] | [3064.0, 3064.0] | [18.0, 18.0] | [371, 391] |
p03774 | u225388820 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n,m=map(int,input().split())\np=[tuple(map(int,input().split())) for i in range(n)]\nfor i in range(m):\n c,d=map(int,input().split())\n ans=10**10\n for j,k in p:\n ans=min(ans,abs(c-j)+abs(d-k))\n print(ans)', 'n,m=map(int,input().split())\nnow=[tuple(map(int,input().split())) for i in range(n)]\np=[tuple(map(int,input().split())) for i in range(m)]\nfor a in now:\n ans=10**10\n for c in p:\n ans=min(ans,abs(c[0]-a[0])+abs(c[1]-a[1]))\n print(ans)\n', 'n,m=map(int,input().split())\nnow=[tuple(map(int,input().split())) for i in range(n)]\np=[tuple(map(int,input().split())) for i in range(n)]\nfor a in now:\n ans=10**10\n for c in p:\n ans=min(ans,abs(c[0]-a[0])+abs(c[1]-a[1]))\n print(ans)\n', 'n,m=map(int,input().split())\nnow=[tuple(map(int,input().split())) for i in range(n)]\np=[tuple(map(int,input().split())) for i in range(n)]\nfor a,b in now:\n ans=10**10\n for c,d in p:\n ans=min(ans,abs(c-a)+abs(d-b))\n print(ans)\n', 'n,m=map(int,input().split())\na=[list(map(int,input().split())) for i in range(n)]\nc=[list(map(int,input().split())) for i in range(m)]\ndef d(x,y):\n return abs(x[0]-y[0])+abs(x[1]-y[1])\nfor i in a:\n ans=10101001010\n ch=0\n for j in range(m):\n if d(i,c[j])<ans:\n ch=j\n ans=d(i,c[j])\n print(ch+1)\n'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s029950522', 's107506721', 's680962023', 's923658512', 's062957573'] | [3060.0, 3188.0, 3060.0, 3060.0, 3064.0] | [18.0, 19.0, 19.0, 19.0, 18.0] | [209, 240, 240, 232, 337] |
p03774 | u239375815 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n, m = map(int, input().split())\n\na = [[0, 0] for i in range(n)]\n\nc = [[0, 0] for i in range(m)]\n\nfor i in range(n):\n a[i][0], a[i][1] = map(int, input().split())\n\nfor i in range(m):\n c[i][0], c[i][1] = map(int, input().split())\n\nindex = 0\n\nprint(a,c)\n\nfor i in range(n):\n for j in range(m):\n if j == 0 :\n k = abs(a[i][0] - c[j][0]) + abs(a[i][1] - c[j][1]) +1\n\n di = abs(a[i][0] - c[j][0]) + abs(a[i][1] - c[j][1])\n if di < k:\n index = j + 1\n k = di\n print(index)', 'n, m = map(int, input().split())\n\na = [[0, 0] for i in range(n)]\n\nc = [[0, 0] for i in range(m)]\n\nfor i in range(n):\n a[i][0], a[i][1] = map(int, input().split())\n\nfor i in range(m):\n c[i][0], c[i][1] = map(int, input().split())\n\nindex = 0\n\n\nfor i in range(n):\n for j in range(m):\n if j == 0 :\n k = abs(a[i][0] - c[j][0]) + abs(a[i][1] - c[j][1]) +1\n\n di = abs(a[i][0] - c[j][0]) + abs(a[i][1] - c[j][1])\n if di < k:\n index = j + 1\n k = di\n print(index)\n'] | ['Wrong Answer', 'Accepted'] | ['s387277809', 's838077062'] | [3064.0, 3064.0] | [19.0, 19.0] | [530, 520] |
p03774 | u248670337 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['3 4\n10 10\n-10 -10\n3 3\n1 2\n2 3\n3 5\n3 5', 'n,m=map(int,input().split())\nA = [list(map(int,input().split())) for _ in range(n)]\nC = [list(map(int,input().split())) for _ in range(m)]\nfor a,b in A:\n l=[abs(a-c)+abs(b-d) for c,d in C]\n print(l.index(min(l))+1)'] | ['Runtime Error', 'Accepted'] | ['s514986708', 's290325687'] | [2940.0, 3060.0] | [17.0, 18.0] | [37, 216] |
p03774 | u252964975 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['def distance(a,b,c,d):\n return abs(a-c)+abs(b-d)\n\nN,M=map(int, input().split())\nAlist = []\nBlist = []\nfor i in range(N):\n a,b=map(int, input().split())\n Alist.append(a)\n Blist.append(b)\nClist = []\nDlist = []\nfor i in range(M):\n c,d=map(int, input().split())\n Clist.append(c)\n Dlist.append(d)\n\nfor i in range(N):\n min_d = 10*10\n a = Alist[i]\n for k in range(M):\n b = Blist[k]\n if min_d > distance(a[0],a[1],b[0],b[1]):\n min_d = distance(a[0],a[1],b[0],b[1])\n kiroku = k\n print(k)\n', 'def distance(a,b,c,d):\n return abs(a-c)+abs(b-d)\n\nN,M=map(int, input().split())\nAlist = []\nBlist = []\nfor i in range(N):\n a,b=map(int, input().split())\n Alist.append(a)\n Blist.append(b)\nClist = []\nDlist = []\nfor i in range(M):\n c,d=map(int, input().split())\n Clist.append(c)\n Dlist.append(d)\n\nfor i in range(N):\n min_d = 10**10\n a = Alist[i]\n b = Blist[i]\n for k in range(M):\n c = Clist[k]\n d = Dlist[k]\n if min_d > distance(a,b,c,d):\n min_d = distance(a,b,c,d)\n kiroku = k\n# print(a,b,c,d,distance(a,b,c,d),min_d)\n print(kiroku+1)'] | ['Runtime Error', 'Accepted'] | ['s701852859', 's568278779'] | [3064.0, 3064.0] | [18.0, 19.0] | [506, 565] |
p03774 | u257332942 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['a, b, c, d = [0] * n, [0] * n, [0] * m, [0] * m\nfor i in range(n):\n a[i], b[i] = map(int, input().split())\nfor i in range(m):\n c[i], d[i] = map(int, input().split())\n\nfor i in range(n):\n min_dist, min_c = abs(a[0]-c[0]) + abs(b[0]-d[0]), 0\n for j in range(m):\n dist = abs(a[i]-c[j]) + abs(b[i]-d[j])\n if dist < min_dist:\n min_dist = dist\n min_c = j\n print(min_c+1)', 'n, m = map(int, input().split())\na, b, c, d = [0] * n, [0] * n, [0] * m, [0] * m\nfor i in range(n):\n a[i], b[i] = map(int, input().split())\nfor i in range(m):\n c[i], d[i] = map(int, input().split())\n\nfor i in range(n):\n min_dist, min_c = 10**9, -1\n for j in range(m):\n dist = abs(a[i]-c[j]) + abs(b[i]-d[j])\n if dist < min_dist:\n min_dist = dist\n min_c = j\n print(min_c+1)'] | ['Runtime Error', 'Accepted'] | ['s449214456', 's131452071'] | [8812.0, 9072.0] | [26.0, 27.0] | [415, 423] |
p03774 | u281610856 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ["\nC = []\nD = []\nfor i in range(n):\n a, b = map(int, input().split())\n A.append(a)\n B.append(b)\nfor j in range(m):\n c, d = map(int, input().split())\n C.append(c)\n D.append(d)\nfor i in range(n):\n v_min = float('inf')\n for j in range(m):\n v = abs(A[i] - C[j]) + abs(B[i] - D[j])\n if v_min > v:\n v_min = v\n ans = j + 1\n print(ans)", "n, m = map(int, input().split())\nA = []\nB = []\nC = []\nD = []\nfor i in range(n):\n a, b = map(int, input().split())\n A.append(a)\n B.append(b)\nfor j in range(m):\n c, d = map(int, input().split())\n C.append(c)\n D.append(d)\nfor i in range(n):\n v_min = float('inf')\n for j in range(m):\n v = abs(A[i] - C[j]) + abs(B[i] - D[j])\n if v_min > v:\n v_min = v\n ans = j + 1\n print(ans)"] | ['Runtime Error', 'Accepted'] | ['s606868179', 's522437930'] | [3064.0, 3064.0] | [17.0, 18.0] | [388, 434] |
p03774 | u285443936 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['N, M = map(int, input().split())\na, b, c, d = [],[],[],[]\n\nfor i in range(N):\n ai, bi = map(int, input().split())\n a.append(ai)\n b.append(bi)\n# print(a, b)\nfor j in range(M):\n cj, dj = map(int, input().split())\n c.append(cj)\n d.append(dj)\n \n#print(a,b,c,d)\n \nfor i in range(N):\n dist, min_dist = 0, INF\n ans = 1\n for j in range(M):\n dist = abs(c[j] - a[i]) + abs(d[j] - b[i])\n if dist < min_dist:\n ans = j+1\n min_dist = dist\n# print("ai:{}, bi:{}, cj:{}, dj:{}, dist:{}, ans:{}".format(a[i], b[i], c[j], d[j], dist, ans))\n# print("i:{}, j:{}, dist:{}, min_dist:{}, ans:{}".format(i, j, dist, min_dist, ans))\n\n print(ans)', 'N, M = map(int, input().split())\na, b, c, d = [],[],[],[]\n\nfor i in range(N):\n ai, bi = map(int, input().split())\n a.append(ai)\n b.append(bi)\n# print(a, b)\nfor j in range(M):\n cj, dj = map(int, input().split())\n c.append(cj)\n d.append(dj)\n \n#print(a,b,c,d)\n \nfor i in range(N):\n dist, min_dist = 0, 10**9\n ans = 1\n for j in range(M):\n dist = abs(c[j] - a[i]) + abs(d[j] - b[i])\n if dist < min_dist:\n ans = j+1\n min_dist = dist\n# print("ai:{}, bi:{}, cj:{}, dj:{}, dist:{}, ans:{}".format(a[i], b[i], c[j], d[j], dist, ans))\n# print("i:{}, j:{}, dist:{}, min_dist:{}, ans:{}".format(i, j, dist, min_dist, ans))\n\n print(ans)'] | ['Runtime Error', 'Accepted'] | ['s413933182', 's483811195'] | [3064.0, 3064.0] | [18.0, 18.0] | [690, 692] |
p03774 | u288430479 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n,m = map(int,input().split())\nl_n =list(list(map(int,input().split())) for i in range(n))\nl_m =list(list(map(int,input().split())) for i in range(m))\nq = 1000000\nfor i in range(n):\n for t in range(m):\n a,b = l_n[i]\n c,d = l_m[t]\n v= abs(a-c)+abs(b-d)\n if v<=q:\n q = v\n z = t\n print(z+1)\n q = 100000\n ', 'n,m = map(int,input().split())\nl_n =list(list(map(int,input().split())) for i in range(n))\nl_m =list(list(map(int,input().split())) for i in range(m))\nfor i in range(n):\n q = 10**9\n for t in range(m):\n a,b = l_n[i]\n c,d = l_m[t]\n v= abs(a-c)+abs(b-d)\n if v<q:\n q = v\n z = t\n print(z+1)'] | ['Runtime Error', 'Accepted'] | ['s507620054', 's585506146'] | [3064.0, 3064.0] | [18.0, 19.0] | [329, 310] |
p03774 | u290187182 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ["\nif __name__ == '__main__':\n a, b = map(int, input().split())\n lista=[]\n for i in range(a):\n c = [int(i) for i in input().split()]\n lista.append(c)\n\n listb=[]\n for i in range(b):\n c = [int(i) for i in input().split()]\n listb.append(c)\n\n listc =[]\n\n for i in lista:\n min = 51*51\n minroot=-1\n for j in range(len(listb)):\n root = (i[0] - listb[j][0]) + (i[1] - listb[j][1])\n if root <min:\n min =root\n minroot=j+1\n listc.append(minroot)\n for i in listc:\n print(i)\n", "\nif __name__ == '__main__':\n a, b = map(int, input().split())\n lista=[]\n for i in range(a):\n c = [int(i) for i in input().split()]\n lista.append(c)\n\n listb=[]\n for i in range(b):\n c = [int(i) for i in input().split()]\n listb.append(c)\n\n listc =[]\n\n for i in lista:\n min = 10**9\n minroot=-1\n for j in range(len(listb)):\n root = abs(i[0] - listb[j][0]) + abs(i[1] - listb[j][1])\n if root <min:\n min =root\n minroot=j+1\n listc.append(minroot)\n for i in listc:\n print(i)\n\n"] | ['Wrong Answer', 'Accepted'] | ['s893818671', 's566229523'] | [3064.0, 3064.0] | [18.0, 19.0] | [600, 607] |
p03774 | u306412379 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n, m = map(int, input().split())\nstudents = [list(map(int, input().split())) for i in range(n)]\n\ntargets = [list(map(int, input().split())) for i in range(m)]\nx = 0\nsnumber = [(0, x)] * n\n \ndef md(s, t):\n d = abs(s[0] - t[0]) + abs(s[1] - t[1])\n return d\n\nfor i in range(n):\n x = 2 * 10 ** 8\n for j in range(m): \n if x >= md(students[i], targets[j]):\n x = md(students[i], targets[j])\n snumber[i] = (j+1, md(students[i], targets[j]))\n \nfor i in range(n): \n print(snumber[i][0])', 'n, m = map(int, input().split())\nstudents = [list(map(int, input().split())) for i in range(n)]\n\ntargets = [list(map(int, input().split())) for i in range(m)]\nx = 0\nsnumber = [(0, x)] * n\n \ndef md(s, t):\n d = abs(s[0] - t[0]) + abs(s[1] - t[1])\n return d\n\nfor i in range(n):\n x = 4 * 10 ** 8\n for j in range(m): \n if x > md(students[i], targets[j]):\n x = md(students[i], targets[j])\n snumber[i] = (j+1, md(students[i], targets[j]))\n \nfor i in range(n): \n print(snumber[i][0])'] | ['Wrong Answer', 'Accepted'] | ['s489240723', 's031513713'] | [9152.0, 9244.0] | [27.0, 28.0] | [508, 507] |
p03774 | u322185540 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n,m = map(int,input().split())\nx = [0]*n\ny = [0]*n\nmx = [0]*m\nmy = [0]*m\nfor i in range(n):\n x[i],y[i] = map(int,input().split())\nfor j in range(m):\n mx[j],my[j] = map(int,input().split())\nans = [0]*n\nfor k in range(n):\n dis = 0\n cnt = 1\n for l in range(n):\n if abs(x[k]-xs[l])+abs(y[k]-ys[l]) > dis:\n dis = abs(x[k]-xs[l])+abs(y[k]-ys[l])\n cnt = l+1\n ans[k] = cnt\nfor h in ans:\n print(h)', 'n,m = map(int,input().split())\nstudent = []\nCoodinate = []\nfor i in range(n):\n student.append(list(map(int,input().split())))\nfor j in range(m):\n Coodinate.append(list(map(int,input().split())))\nans = []\n#print(student)\n#print(Coodinate)\nfor k in student:\n manhattan = 100000000000\n number = 0\n for u in range(m):\n manhattann = abs(k[0]-Coodinate[u][0])+abs(k[1]-Coodinate[u][1])\n if manhattann < manhattan:\n manhattan = manhattann\n number = u+1\n ans.append(number)\nfor y in ans:\n print(y)'] | ['Runtime Error', 'Accepted'] | ['s296266805', 's712064494'] | [3064.0, 3064.0] | [18.0, 19.0] | [438, 546] |
p03774 | u343437894 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n, m = map(int, input().split(" "))\n\ndef abs(n):\n return n if n>0 else -n\n\n\nfor i in range(1, n+1):\n ab = list(map(int, input().split(" ")))\nfor j in range(1, m+1):\n cd = list(map(int, input().split(" ")))\n\nfor i in range(0, n):\n delta = 999999999999\n ans=0\n for j in range(0, m):\n newdelta = abs(ab[i][0]-cd[j][0]) + abs(ab[i][1]-cd[j][1])\n if delta>newdelta:\n delta=newdelta\n ans=j+1\n print(ans)\n\n', 'import math;\n\nn, m = map(int, input().split(" "));\nab = [];\nfor i in range(0, n):\n ab.append(input().split(" "));\n\ncd = [];\nfor i in range(0, m):\n cd.append(input().split(" "));\n\nfor i in range(0, n):\n dist=9999999999999\n nearm=0;\n for j in range(0, m):\n dist2 = math.fabs(int(ab[i][0]) - int(cd[j][0])) + math.fabs(int(ab[i][1]) - int(cd[j][1]));\n if dist2 < dist:\n dist = dist2;\n nearm=j;\n print(nearm);\n\n\n', 'import math;\n\nn, m = map(int, input().split(" "));\nab = [];\nfor i in range(0, n):\n ab.append(input().split(" "));\n\ncd = [];\nfor i in range(0, m):\n cd.append(input().split(" "));\n\nfor i in range(0, n):\n dist=9999999999999\n nearm=0;\n for j in range(0, m):\n dist2 = math.fabs(int(ab[i][0]) - int(cd[j][0])) + math.fabs(int(ab[i][1]) - int(cd[j][1]));\n if dist2 < dist:\n dist = dist2;\n nearm=j;\n print(nearm+1);\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s306293552', 's896935662', 's065337278'] | [3064.0, 3064.0, 3064.0] | [18.0, 21.0, 21.0] | [456, 464, 464] |
p03774 | u350093546 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n,m=map(int,input().split())\na=[list(map(int,input().split())) for i in range(n)]\nb=[list(map(int,input().split())) for i in range(m)]\nfor i in a:\n cnt=2*(10**16)\n ans=0\n for j in range(len(b)):\n if abs(i[0]*b[j][0])+ abs(i[1]*b[j][1])<cnt:\n cnt=abs(i[0]*b[j][0])+ abs(i[1]*b[j][1])\n ans=j+1\n print(ans)', 'n,m=map(int,input().split())\na=[list(map(int,input().split())) for i in range(n)]\nb=[list(map(int,input().split())) for i in range(m)]\nfor i in a:\n cnt=2*(10**16)\n ans=0\n for j in range(len(b)):\n if abs(i[0]-b[j][0])+ abs(i[1]-b[j][1])<cnt:\n cnt=abs(i[0]-b[j][0])+ abs(i[1]-b[j][1])\n ans=j+1\n print(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s770963443', 's417999249'] | [9108.0, 9148.0] | [28.0, 27.0] | [320, 321] |
p03774 | u362560965 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['N,M = map(int,input().split())\n\na = [0 for i in range(N)]\nb = [0 for i in range(N)]\nc = [0 for i in range(M)]\nd = [0 for i in range(M)]\n\nfor i in range(N):\n a[i],b[i] = map(int,input().split())\n\nfor i in range(M):\n c[i],d[i] = map(int,input().split())\n\nfor i in range(N):\n for j in range(M):\n dist = []\n tmp = abs(a[i]-c[i]) + abs(b[i]-d[i])\n dist.append(tmp)\n\n print(dist.index(min(dist)))', 'N,M = map(int,input().split())\n\na = [0 for i in range(N)]\nb = [0 for i in range(N)]\nc = [0 for i in range(M)]\nd = [0 for i in range(M)]\n\nfor i in range(N):\n a[i],b[i] = map(int,input().split())\n\nfor i in range(M):\n c[i],d[i] = map(int,input().split())\n\nfor i in range(N):\n dist = []\n\n for j in range(M):\n tmp = abs(a[i]-c[j]) + abs(b[i]-d[j])\n dist.append(tmp)\n\n print(dist.index(min(dist)) + 1)'] | ['Runtime Error', 'Accepted'] | ['s963777468', 's783190023'] | [3064.0, 3064.0] | [19.0, 19.0] | [423, 424] |
p03774 | u364741711 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n,m=map(int,input().split())\n\nli=[list(map(int,input().split())) for i in range(n)]\nlj=[list(map(int,input().split())) for i in range(m)]\n\nfor i in range(n):\n li_distance=[abs(lj[j][0]-li[i][0])+abs(lj[j][1]-li[i][1]) for j in range(m)]\n print(li_distance.index(min(li_distance)+1))\n ', 'n,m=map(int,input().split())\n\nli=[list(map(int,input().split())) for i in range(n)]\nlj=[list(map(int,input().split())) for i in range(m)]\n\nfor i in range(n):\n li_distance=[abs(lj[j][0]-li[i][0])+abs(lj[j][1]-li[i][1]) for j in range(m)]\n print(li_distance.index(min(li_distance))+1)\n '] | ['Runtime Error', 'Accepted'] | ['s862703145', 's310171085'] | [3060.0, 3060.0] | [19.0, 19.0] | [293, 293] |
p03774 | u366644013 | 2,000 | 262,144 | There are N students and M checkpoints on the xy-plane. The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j). When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_. The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|. Here, |x| denotes the absolute value of x. If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index. Which checkpoint will each student go to? | ['n, m = map(int, input().split())\ns = [list(map(int, input().split())) for _ in range(n)]\np = [list(map(int, input().split())) for _ in range(m)]\nfor i in range(n):\n mindis = 10 ** 9\n for j in range(m):\n dis = abs(s[i][0] - p[j][0]) + abs(s[i][1] - p[j][1])\n if mindis > dis:\n p = j+1\n mindis = dis\n print(p)', 'n, m = map(int, input().split())\ns = [list(map(int, input().split())) for _ in range(n)]\np = [list(map(int, input().split())) for _ in range(m)]\nfor i in range(n):\n mindis = 10 ** 9\n for j in range(m):\n dis = abs(s[i][0] - p[j][0]) + abs(s[i][1] - p[j][1])\n if mindis > dis:\n point = j+1\n mindis = dis\n print(point)'] | ['Runtime Error', 'Accepted'] | ['s028509077', 's440534970'] | [3064.0, 3064.0] | [18.0, 19.0] | [352, 360] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.