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
|
---|---|---|---|---|---|---|---|---|---|---|
p03239 | u669770658 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["import collections\n\nn, T = map(int, input().split())\n\ninput_dict = collections.OrderedDict()\n\nfor _ in range(n):\n a, b = list(map(int, input().split()))\n input_dict[a] = b\n\nt = min([value for key, value in input_dict.items() if key <= T])\n\nans = [i for i, x in enumerate(input_dict.values()) if x == t]\n\nif ans is []:\n print('TLE')\n\nelse:\n print(list(input_dict.keys()).index(ans))", 'def abc112_b():\n n, limit_time = map(int, input().split())\n ans = 10000\n\n for _ in range(n):\n cost, time = map(int, input().split())\n\n if time <= limit_time and ans > cost:\n ans = cost\n\n return ans if ans != 10000 else "TLE"\n\n\nif __name__ == \'__main__\':\n print(abc112_b())'] | ['Runtime Error', 'Accepted'] | ['s799709587', 's493026252'] | [3316.0, 3060.0] | [21.0, 19.0] | [393, 312] |
p03239 | u677312543 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["N, T = map(int, input().split())\n\nans 1003\nfor _ in range(N):\n c, t = map(int, input().split())\n if t <= T:\n ans = min(ans, c)\n\nprint('TLE' if ans==1003 else ans)\n", "n, T = map(int, input().split())\nans = 1003\nfor _ in range(n):\n c, t = map(int, input().split())\n if t <= T:\n ans = min(ans, c)\n\nprint('TLE' if ans == 1003 else ans)\n"] | ['Runtime Error', 'Accepted'] | ['s081777643', 's629101128'] | [2940.0, 2940.0] | [17.0, 18.0] | [177, 179] |
p03239 | u682467216 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["n,T = map(int, input().split())\ni = 1001\n \nfor _ in range(N):\n c, t = map(int, input().split())\n if t <= T:\n i = min(i, c)\n\nif i == 1001:\n print('TLE')\nelse:\n print(i)", "N, T = map(int, input().split())\ni = 1001\n \nfor _ in range(N):\n c, t = map(int, input().split())\n if t <= T:\n i = min(i, c)\n\nif i == 1001:\n print('TLE')\nelse:\n print(i)"] | ['Runtime Error', 'Accepted'] | ['s758738250', 's464627871'] | [2940.0, 2940.0] | [20.0, 17.0] | [174, 175] |
p03239 | u686036872 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["N, T = map(int, input().split())\nfor i in range(N):\n c, t = map(int, input().split())\n if t<=T:\n x=min(c, 1001)\nprint('TLE' if x=1001 else c)", "N, T = map(int, input().split())\nz=1001\nfor i in range(N):\n c, t = map(int, input().split())\n if t<=T:\n min=(c, z)\nprint('TLE' if min=1001 else c)", "N, T = map(int, input().split())\nfor i in range(N):\n c, t = map(int, input().split())\n if t<=T:\n print(min(c))\n else:\n print('TLE')", "N, T = map(int, input().split())\nfor i in range(N):\n c, t = map(int, input().split())\n if t<=T:\n print(min(c))\n else:\n print('TLE')", "N, T = map(int, input().split())\nfor i in range(N):\n c, t = map(int, input().split())\n if t<=T:\n min=(c, 1001)\nprint('TLE' if min=1001 else c)", "N, T = map(int, input().split())\nfor i in range(N):\n c, t = map(int, input().split())\n if t<=T:\n min=(c)\n print(min)\n else:\n print('TLE')", "N, T = map(int, input().split())\nfor i in range(N):\n c, t = map(int, input().split())\n if t<=T:\n min=min(c, 1001)\nprint('TLE' if min=1001 else c)", 'N, T = map(int, input().split())\n\ncost = float("inf")\nfor i in range(N):\n c, t = map(int, input().split())\n if t <= T:\n cost = min(cost, c) \n\nprint("TLE" if cost == float("inf") else cost)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s189259366', 's201977712', 's524531675', 's550809658', 's559501576', 's743890909', 's844671400', 's572120474'] | [2940.0, 2940.0, 3316.0, 2940.0, 2940.0, 3316.0, 2940.0, 2940.0] | [17.0, 17.0, 21.0, 18.0, 17.0, 20.0, 17.0, 17.0] | [146, 151, 140, 140, 147, 149, 150, 201] |
p03239 | u691896522 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['n, t = list(map(int, input().split()))\ndata = []\nfor i in range(n):\n data.append(list(map(int, input().split())))\nminCost = 1001\nfor i in range(n):\n if data[i][1] <= t && minCost > data[i][0]:\n minCost = data[i][0]\n\nif minCost == 1001:\n print("TLE")\nelse:\n print(minCost)', 'n, t = list(map(input().split()))\ndata = []\nfor i in range(n):\n data.append(list(map(input().split())))\nminCost = 1001\nfor i in range(n):\n if data[i][1] <= t:\n minCost = data[i][0]\n\nif minCost == 1001:\n printf("TLE")\nelse:\n printf(minCost)', 'n, t = list(map(int, input().split()))\ndata = []\nfor i in range(n):\n data.append(list(map(int, input().split())))\nminCost = 1001\nfor i in range(n):\n if data[i][1] <= t and minCost > data[i][0]:\n minCost = data[i][0]\n\nif minCost == 1001:\n print("TLE")\nelse:\n print(minCost)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s836341860', 's840489770', 's668171865'] | [2940.0, 3060.0, 3060.0] | [17.0, 17.0, 17.0] | [290, 258, 291] |
p03239 | u693933222 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['Base = input().split(" ")\nN = int(Base[0])\nTL = int(Base[1])\nTX = 10000\n\nfor i in range(N):\n Roi = input().split(" ")\n Coi = int(Roi[0])\n TLi = int(Roi[1])\n if TL >= TLi:\n if TX >= int(Coi) or i ==0:\n TX = Coi\nif TX == 10000:\n print("TLE")\nelif:\n print(TX)', 'Base = input().split(" ")\nN = int(Base[0])\nTL = int(Base[1])\nTX = 10000\n\nfor i in range(N):\n Roi = input().split(" ")\n Coi = int(Roi[0])\n TLi = int(Roi[1])\n if TL >= TLi:\n if TX >= int(Coi) or i ==0:\n TX = Coi\nif TX == 10000:\n print("TLE")\nelse:\n print(TX)'] | ['Runtime Error', 'Accepted'] | ['s328120690', 's356891195'] | [2940.0, 3064.0] | [17.0, 17.0] | [292, 292] |
p03239 | u698416089 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['nt = input().split()\nct = ["0"]\nfor i in range(int(nt[0])):\n inp = input().split()\n if int(inp[1]) <= int(nt[1]):\n ct.append(inp[0])\nprint(ct)\nct.sort()\nprint(ct)\nif len(ct) == 1:\n print("TLE")\nelse:\n print(ct[1])\n', 'nt = input().split()\nct = [0]\nfor i in range(int(nt[0])):\n inp = input().split()\n if int(inp[1]) <= int(nt[1]):\n ct.append(int(inp[0]))\nprint(ct)\nct.sort()\nprint(ct)\nif len(ct) == 1:\n print("TLE")\nelse:\n print(ct[1])', 'nt = input().split()\nct = ["0"]\nfor i in range(int(nt[0])):\n inp = input().split()\n if int(inp[1]) <= int(nt[1]):\n ct.extend(list(inp[0]))\nct.sort()\nprint(ct)\nif len(ct) == 1:\n print("TLE")\nelse:\n print(ct[1])', 'nt = input().split()\nct = ["0"]\nfor i in range(int(nt[0])):\n inp = input().split()\n if int(inp[1]) <= int(nt[1]):\n ct.extend(inp[0])\nprint(ct)\nct.sort()\nprint(ct)\nif len(ct) == 1:\n print("TLE")\nelse:\n print(ct[1])', 'nt = input().split()\nct = [0]\nfor i in range(int(nt[0])):\n inp = input().split()\n if int(inp[1]) <= int(nt[1]):\n ct.append(int(inp[0]))\nct.sort()\nif len(ct) == 1:\n print("TLE")\nelse:\n print(ct[1])'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s268010431', 's527385310', 's545092930', 's916288824', 's519989250'] | [3060.0, 3064.0, 3060.0, 3064.0, 3060.0] | [18.0, 18.0, 17.0, 18.0, 18.0] | [233, 235, 228, 232, 215] |
p03239 | u699944218 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["N,T = list(map(int,input().split()))\nc = [None for _ in range(N)]\nt = [None for _ in range(N)]\nA = [None for _ in range(N)]\nfor i in range(N):\n c[i], t[i] = input().split()\n c[i] = int(c[i])\n t[i] = int(t[i])\nfor i in range(N):\n if t[i] <= T:\n A[i] = c[i]\nA = [a for a in A if type(a) != 'Nonetype']\nA = sorted(A)\nans = A[0]\nprint(ans)", "N, T = list(map(int,input().split()))\nc = [0 for i in range(N)]\nt = [0 for i in range(N)]\nfor i in range(N):\n c[i], t[i] = input().split()\n c[i] = int(c[i])\n t[i] = int(t[i])\n\nans = float('inf')\nfor i in range(N):\n if t[i] <= T and c[i] < ans:\n ans = c[i]\nif ans == float('inf'):\n print('TLE')\nelse:\n print(ans)"] | ['Runtime Error', 'Accepted'] | ['s046202050', 's897409611'] | [3064.0, 3064.0] | [27.0, 17.0] | [342, 320] |
p03239 | u702208001 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["n, limit = map(int, input().split())\ncost = list()\nfor _ in range(n):\n c, time = [int(a) for a in input().split()]\n if time <= limit:\n cost.append(c)\nprint(max(cost) if len(cost) > 0 else 'TLE')\n", 'n, limit = map(int, input().split())\ncost = list()\nfor _ in range(n):\n c, time = [int(a) for a in input().split()]\n if time <= limit:\n cost.append(c)\nprint(max(cost))', "n, limit = map(int, input().split())\ncost = list()\nfor _ in range(n):\n c, time = [int(a) for a in input().split()]\n if time <= limit:\n cost.append(c)\nprint(min(cost) if len(cost) > 0 else 'TLE')\n"] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s171782185', 's443863108', 's675613438'] | [2940.0, 2940.0, 3064.0] | [19.0, 18.0, 18.0] | [200, 171, 200] |
p03239 | u708255304 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["import sys\nN, T = map(int, sys.stdin.readline().strip().split()) \n\ncost = 1001\nfor line in sys.stdin.readlines():\n c, t = line.strip().split()\n if T >= t:\n cost = min(cost, c)\n\nif cost == 1001:\n print('TLE')\nelse:\n print(cost)\n", "import sys\nN, T = map(int, sys.stdin.readline().strip().split()) \n\ncost = 1001\nfor line in sys.stdin.readlines():\n c, t = map(int, line.strip().split())\n if T >= t:\n cost = min(cost, c)\n\nif cost == 1001:\n print('TLE')\nelse:\n print(cost)\n"] | ['Runtime Error', 'Accepted'] | ['s756451792', 's573537252'] | [2940.0, 2940.0] | [17.0, 17.0] | [286, 296] |
p03239 | u711539583 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['n, t = map(int, input().split())\nk = [list(map(int, input().split())) for _ in range(n)]\na = [item[0] for item in k if item[1] <= t]\nif k:\n print(min(k))\nelse:\n print("TLE")', 'n, t = map(int, input().split())\nk = [list(map(int, input().split())) for _ in range(n)]\na = [item[0] for item in k if item[1] <= t]\nif a:\n print(min(a))\nelse:\n print("TLE")'] | ['Wrong Answer', 'Accepted'] | ['s956712235', 's919470729'] | [3060.0, 3060.0] | [17.0, 17.0] | [175, 175] |
p03239 | u716530146 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["N,T=map(int,input().split())\nct=[tuple(map(int,input().split())) for i in range(n)]\nans=10**9\nfor c,t in ct:\n if T<t:\n continue\n else:\n ans=min(ans,c)\nprint(ans if ans!=10**9 else 'TLE')\n", "N,T=map(int,input().split())\nct=[tuple(map(int,input().split())) for i in range(N)]\nans=10**9\nfor c,t in ct:\n if T<t:\n continue\n else:\n ans=min(ans,c)\nprint(ans if ans!=10**9 else 'TLE')\n"] | ['Runtime Error', 'Accepted'] | ['s819458992', 's748269241'] | [2940.0, 2940.0] | [18.0, 17.0] | [207, 207] |
p03239 | u721316601 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["import numpy as np\n\nN, T = list(map(int, input().split()))\n\ns = np.array([])\n\nfor i in range(N):\n s = np.append(s, np.array(list(map(int, input().split()))))\n\ns = s.reshape((N, 2))\n\npos = np.where(s[:, 1] <= T)\n\nif pos[0].shape == (0,):\n print('TLE')\nelse:\n np.sort(s[pos], axis=0)\n print(int(s[0][0]))", "N, T = list(map(int, input().split()))\nct = []\nfor i in range(N):\n ct.append(list(map(int, input().split())))\n\nct.sort()\n\nans = 'TLE'\nfor i in range(N):\n if ct[i][1] <= T:\n ans = ct[i][0]\n break\n\nprint(ans)"] | ['Wrong Answer', 'Accepted'] | ['s160249401', 's037579593'] | [18732.0, 3064.0] | [1244.0, 18.0] | [314, 226] |
p03239 | u729133443 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["i=lambda:map(int,input().split());N,T=i();print(min([0]+[c for c,t in[i()for _ in[0]*N]if t<=T])or'TLE')", "i=lambda:map(int,input().split());N,T=i();print(min([c for c,t in eval('i(),'*N)if t<=T]or['TLE']))"] | ['Wrong Answer', 'Accepted'] | ['s993045428', 's214490193'] | [3060.0, 3060.0] | [18.0, 19.0] | [104, 99] |
p03239 | u731702557 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["N, T = map(int, input().split())\nc = []\nt = []\n\nfor i in range(N):\n box = [0,0]\n box[0], box[1] = map(int, input().split())\n c.append(box[0])\n t.append(box[1])\n\ncost = 1000\ncheck = -1\n\nfor i in range(N):\n if t[i] <=T and c[i] <= cost:\n check = i\n cost = c[i]\n #print(i)\n #print(cost)\n\nif index == -1:\n print('TLE')\nelse:\n print(cost)", "N, T = map(int, input().split())\nc = []\nt = []\n\nfor i in range(N):\n box = [0,0]\n box[0], box[1] = map(int, input().split())\n c.append(box[0])\n t.append(box[1])\n\ncost = 1000\ncheck = -1\nfor i in range(N):\n if t[i] <=T and c[i] <= cost:\n check = i\n cost = c[i]\n #print(i)\n #print(cost)\n\nif check == -1:\n print('TLE')\nelse:\n print(cost)"] | ['Runtime Error', 'Accepted'] | ['s281929438', 's831222550'] | [3064.0, 3064.0] | [17.0, 18.0] | [382, 381] |
p03239 | u732870425 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['n, t = map(int, input())\nct = [map(int(input())) for _ in range(n)]\n\nli = []\nfor i in range(n):\n if ct[i][1] < t:\n li.append(ct[i])\n else:\n continue\n\nif count(li) > 0:\n print(min(li[:][0]))\nelse:\n print("TLE")', 'n, t = map(int, input().split())\nct = [list(map(int,input().split())) for _ in range(n)]\n \nli = []\nfor i in range(n):\n if ct[i][1] <= t:\n li.append(ct[i][0])\n else:\n continue\n \nif len(li) > 0:\n print(min(li))\nelse:\n print("TLE")'] | ['Runtime Error', 'Accepted'] | ['s532386418', 's123201715'] | [3060.0, 3060.0] | [17.0, 18.0] | [219, 238] |
p03239 | u736729525 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['N, T = [int(x) for x in input().strip()]\n\nok = 2000\nfor _ in range(N):\n c, t = [int(x) for x in input().strip()]\n if t <= T:\n ok = min(ok, c)\n\nprint("TLE" if ok == 2000 else ok)\n', 'N, T = [int(x) for x in input().split()]\n\nok = 2000\nfor _ in range(N):\n c, t = [int(x) for x in input().split()]\n if t <= T:\n ok = min(ok, c)\n\nprint("TLE" if ok == 2000 else ok)\n'] | ['Runtime Error', 'Accepted'] | ['s003708997', 's614026652'] | [2940.0, 2940.0] | [17.0, 17.0] | [183, 183] |
p03239 | u748377775 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['def input_N_T():\n N_T=input().split()\n int_N_T=list(map(int,N_T))\n N=int_N_T[0]\n T=int_N_T[1]\n return [N,T]\n\nN,T=input_N_T()\n\nmin_c,min_t=1001,1001\n\nfor i in range(N):\n c,t=input_N_T()\n if(t<=T and min(min_c,c)==c):\n min_c,min_t=c,t\n\nif(N==1001 and T==1001):\n print("TLE")\n \nelse:\nprint(c)', 'def input_N_T():\n N_T=input().split()\n int_N_T=list(map(int,N_T))\n N=int_N_T[0]\n T=int_N_T[1]\n return [N,T]\n\nN,T=input_N_T()\n\nmin_c,min_t=1001,1001\n\nfor i in range(N):\n c,t=input_N_T()\n if(t<=T and min(min_c,c)==c):\n min_c=c\n\nif(min_c==1001):\n print("TLE")\n \nelse:\n print(min_c)'] | ['Runtime Error', 'Accepted'] | ['s913106093', 's137089881'] | [2940.0, 3060.0] | [18.0, 18.0] | [323, 315] |
p03239 | u754553095 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['a=[]\nb=1000\nn,t=map(int,input().split(" "))\nfor _ in range(n):\n a.append(tuple(map(int,input().split(" "))))\nfor i in range(n):\n if t>=a[i][1]:\n if b>a[i][0]:\n b=a[i][0]\nif b !=1000:\n print(b)\nif b==1000\n print("TLE")', 'a=[]\nb=1000\nn,t=map(int,input().split(" "))\nfor _ in range(n+1):\n a.append(tuple(map(int,input().split(" "))))\nfor i in range(n+1):\n if t>=a[i][1]:\n if b>a[i][0]:\n b=a[i][0]\nif b !=1000:\n print(b)\nelse:\n print("TLE")', 'a=[]\nb=1001\nn,t=map(int,input().split(" "))\nfor _ in range(n):\n a.append(tuple(map(int,input().split(" "))))\nfor i in range(n):\n if t>=a[i][1]:\n if b>a[i][0]:\n b=a[i][0]\nif b !=1001:\n print(b)\nelse:\n print("TLE")'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s475971330', 's781413767', 's986687171'] | [2940.0, 3060.0, 3060.0] | [17.0, 18.0, 18.0] | [247, 246, 242] |
p03239 | u757030836 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['n,t = map(int,input().split())\n\nct = [[int(i) for i in input().split()] for _ in range(n)]\n\nx=[]\nfor i in range(n):\n if ct[i][1] <= t:\n x.append(ct[i][0])\n \n \nx.sotr()\n\nprint(x[0])', 'n,t = map(int,input().split())\n\nct = [[int(i) for i in input().split()] for _ in range(n)]\n\nx=[]\nfor i in range(n):\n if ct[i][1] <= t:\n x.append(ct[i][0])\n \n \nx.sort()\n\nif len(x) != 0:\n print(x[0])\nelse:\n print("TLE")\n\n'] | ['Runtime Error', 'Accepted'] | ['s635249900', 's469526122'] | [3060.0, 3060.0] | [18.0, 17.0] | [190, 231] |
p03239 | u777028980 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['N,T=map(int, input().split())\nans=9999\nfor i inrange(N):\n A,B=map(int, input().split())\n if (T>B):\n if(ans>A):\n ans=A\nif(ans==9999):\n print("TLE")\nelse:\n print(ans)', 'N,T=map(int, input().split())\nans=9999\nfor i in range(N):\n A,B=map(int, input().split())\n if (T>=B):\n if(ans>=A):\n ans=A\nif(ans==9999):\n print("TLE")\nelse:\n print(ans)'] | ['Runtime Error', 'Accepted'] | ['s740935058', 's116357365'] | [2940.0, 3060.0] | [17.0, 18.0] | [176, 179] |
p03239 | u778700306 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['\nn,t=map(int,input().split())\n\nres=None\n\nfor _ in range(n):\n c,u=map(int,input().split())\n if u <= t:\n res = min(res,u) if res else u\n\nprint(res if res else "TLE")', '\nn,t=map(int,input().split())\n\nres=None\n\nfor _ in range(n):\n c,u=map(int,input().split())\n if u <= t:\n res = min(res,c) if res else c\n\nprint(res if res else "TLE")'] | ['Wrong Answer', 'Accepted'] | ['s733828999', 's939110537'] | [2940.0, 2940.0] | [19.0, 17.0] | [176, 176] |
p03239 | u779728630 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['N, T = map(int, input().split())\nc = 1001\nfor i in range(N):\n c, t = map(int, input().split())\n if t <= T:\n ans = min(ans, c)\nprint(ans) if c < 1001 else print("TLE")', 'N, T = map(int, input().split())\nans = 1001\nfor i in range(N):\n c, t = map(int, input().split())\n if t <= T:\n ans = min(ans, c)\nprint(ans) if ans < 1001 else print("TLE")\n'] | ['Runtime Error', 'Accepted'] | ['s796842378', 's394975423'] | [9188.0, 9160.0] | [27.0, 26.0] | [171, 176] |
p03239 | u784022244 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['N,T=map(int, input().split())\nans=10**9\nfor i in range(N):\n c,t=map(int, input().split())\n if t<=T:\n ans=min(ans,c)\nif ans=10**9:\n print("TLE")\nelse:\n print(ans)', 'N,T=map(int, input().split())\nans=10**9\nfor i in range(N):\n c,t=map(int, input().split())\n if t<=T:\n ans=min(ans,c)\nif ans==10**9:\n print("TLE")\nelse:\n print(ans)'] | ['Runtime Error', 'Accepted'] | ['s764234680', 's946950660'] | [2940.0, 2940.0] | [17.0, 17.0] | [168, 169] |
p03239 | u785578220 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['print("TLE")', 'n,w = map(int,input().split())\nm = 1001\nfor i in range(n):\n a,b = map(int,input().split())\n if b <= w and a < m:\n m = a\nif m == 1001:\n print("TLE")\nelse:\n print(m)\n '] | ['Wrong Answer', 'Accepted'] | ['s425456252', 's871743251'] | [2940.0, 2940.0] | [18.0, 18.0] | [12, 187] |
p03239 | u787562674 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["N, T = map(int, input().split())\n\nans = 10 ** 9\n\nfor _ in rnage(N):\n a, b = map(int, input().split())\n if b <= T:\n ans = min(ans, b)\n\nif ans == 10 ** 9:\n print('TLE')\nelse:\n print(ans)", "N, T = map(int, input().split())\n\nans = 10 ** 9\n\nfor _ in range(N):\n a, b = map(int, input().split())\n if b <= T:\n ans = min(ans, a)\n\nif ans == 10 ** 9:\n print('TLE')\nelse:\n print(ans)"] | ['Runtime Error', 'Accepted'] | ['s576856655', 's258078491'] | [2940.0, 2940.0] | [17.0, 18.0] | [203, 203] |
p03239 | u790301364 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['\ndef main04():\n buf = input("");\n bufs = buf.split(" ");\n val1 = [];\n for i in range(len(bufs)):\n val1.append(int(bufs[i]));\n val2 = [];\n for i in range(val1[0]):\n buf = input("");\n bufs = buf.split(" ");\n kari = [];\n kari.append(int(bufs[0]));\n kari.append(int(bufs[1]));\n val2.append(kari);\n min1 = 10000;\n for i in range(val1[0]):\n if val2[1][i] < val1[1] and val2[0][i] < min1:\n min1 = val2[0][i];\n if min1 == 10000:\n print("TLE");\n else:\n print(min1);\n\nif __name__ == \'__main__\':\n main04()', 'def main04():\n buf = input("");\n bufs = buf.split(" ");\n val1 = [];\n for i in range(len(bufs)):\n val1.append(int(bufs[i]));\n val2 = [];\n for i in range(val1[0]):\n buf = input("");\n bufs = buf.split(" ");\n kari = [];\n kari.append(int(bufs[0]));\n kari.append(int(bufs[1]));\n val2.append(kari);\n min1 = 10000;\n for i in range(val1[0]):\n if val2[1][i] < val1[1] and val2[0][i] < min1:\n min1 = val2[0][i];\n if min1 == 10000:\n print("TLE");\n else:\n print(min1);\n\nif __name__ == \'__main__\':\n main03()', 'def main04():\n buf = input("");\n bufs = buf.split(" ");\n val1 = [];\n for i in range(len(bufs)):\n val1.append(int(bufs[i]));\n val2 = [];\n for i in range(val1[0]):\n buf = input("");\n bufs = buf.split(" ");\n kari = [];\n kari.append(int(bufs[0]));\n kari.append(int(bufs[1]));\n val2.append(kari);\n min1 = 10000;\n for i in range(val1[0]):\n if val2[i][1] < val1[1] + 1 and val2[i][0] < min1:\n min1 = val2[i][0];\n if min1 == 10000:\n print("TLE");\n else:\n print(min1);\n\nif __name__ == \'__main__\':\n main04()\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s046444923', 's353585626', 's004125872'] | [3064.0, 3064.0, 3064.0] | [18.0, 18.0, 18.0] | [608, 607, 612] |
p03239 | u796942881 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['N, T = map(int, input().split())\n\nct = [int(j) for j in input().split() for i in range(H)]\n\nct.sort(key=lambda x: x[0])\n\nans = 1001\n\nfor i in range(N):\n if ct[i][1] <= T:\n ans = ct[i][0]\n break\n\nprint("TLE" if ans == 1001 else ans)\n', 'N, T = map(int, input().split())\n\nct = [[int(j) for j in input().split()] for i in range(N)]\n\nct.sort(key=lambda x: x[0])\n\nans = 1001\n\nfor i in range(N):\n if ct[i][1] <= T:\n ans = ct[i][0]\n break\n\nprint("TLE" if ans == 1001 else ans)\n'] | ['Runtime Error', 'Accepted'] | ['s546079258', 's195109278'] | [3060.0, 3060.0] | [17.0, 18.0] | [249, 251] |
p03239 | u798316285 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['n,t=map(int,input().split())\ncost_list=[]\nfor i in range(n):\n cost,time=map(int,input().split())\n if time<=t:\n cost_list+=cost\nif cost_list=![]:\n print(min(cost_list))\nelse:\n print(TLE)', 'n,t=map(int,input().split())\ncost_list=[]\nfor i in range(n):\n cost,time=map(int,input().split())\n if time<=t:\n cost_list+=[cost]\nif cost_list!=[]:\n print(min(cost_list))\nelse:\n print("TLE")'] | ['Runtime Error', 'Accepted'] | ['s365924834', 's277014192'] | [2940.0, 2940.0] | [17.0, 17.0] | [192, 196] |
p03239 | u810735437 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["\nN, T = map(int, input().split())\nans = 1e9\nfor n in range(T):\n c, t = map(int, input().split())\n if t <= T:\n ans = min(ans, c)\nif ans == 1e9:\n print('TLE')\nelse:\n print(ans)\n\n", "N, T = map(int, input().split())\nans = 1e9\nfor n in range(N):\n c, t = map(int, input().split())\n if t <= T:\n ans = min(ans, c)\nif ans == 1e9:\n print('TLE')\nelse:\n print(ans)\n\n"] | ['Runtime Error', 'Accepted'] | ['s198096491', 's541489727'] | [3316.0, 3316.0] | [21.0, 23.0] | [195, 194] |
p03239 | u811576279 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['#-*- coding:utf-8 -*- \n\ndef main():\n\tN, T = map(int,input().split())\n\tc_list = []\n\tt_list = []\n\tfor i in range(N):\n\t\tc, t = map(int,input().split())\n\t\tc_list.append(c)\n\t\tt_list.append(t)\n\t\n\tindex_list = []\n\tfor i in range(N):\n\t\tif t_list[i] < T:\n\t\t\tindex_list.append(i)\n\t\n\t#print(index_list)\n\t\n\tif len(index_list) == 0:\n\t\treturn print("TLE")\n\n\tcost_min = float("inf")\n\tfor i in range(len(index_list)):\n\t\tif c_list[i] < cost_min:\n\t\t\tcost_min = c_list[i]\n\t\n\tprint(int(cost_min))\n\t\n\nif __name__ == "__main__":\n\tmain()\n', '#-*- coding:utf-8 -*- \n\ndef main():\n\tN, T = map(int,input().split())\n\tc_list = []\n\tt_list = []\n\tfor i in range(N):\n\t\tc, t = map(int,input().split())\n\t\tc_list.append(c)\n\t\tt_list.append(t)\n\t\n\t#print(t_list)\n\t#print(type(t_list[0]))\n\tindex_list = []\n\tfor i in range(len(t_list)):\n\t\tif t_list[i] <= T:\n\t\t\tindex_list.append(i)\n\t\n\t#print(index_list)\n\t\n\tif len(index_list) == 0:\n\t\treturn print("TLE")\n\n\tcost_min = float("inf")\n\tfor i in index_list:\n\t\tif c_list[i] < cost_min:\n\t\t\tcost_min = c_list[i]\n\t\n\tprint(int(cost_min))\n\t\n\nif __name__ == "__main__":\n\tmain()\n'] | ['Wrong Answer', 'Accepted'] | ['s061907072', 's043457461'] | [3064.0, 3064.0] | [17.0, 17.0] | [515, 555] |
p03239 | u812576525 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['N,T = list(map(int,input().split()))\nC = [list(map(int,input().split())) for i in range(N)]\nC = sorted(C, key = lambda x : x[1],reverse =False)\n\nA =[0]\nfor i in C:\n if i[1] < T:\n A.append(i[0])\n\nprint(min(A) if min(A) != 0 else "TLE")', 'N,T = list(map(int,input().split()))\nC = [list(map(int,input().split())) for i in range(N)]\nC = sorted(C, key = lambda x : x[1],reverse =False)\n#print(C)\n\nA =[1001]\nfor i in C:\n if i[1] <= T:\n A.append(i[0])\n\nprint(min(A) if min(A) != 1001 else "TLE")'] | ['Wrong Answer', 'Accepted'] | ['s295016278', 's633058876'] | [3060.0, 3060.0] | [17.0, 17.0] | [244, 261] |
p03239 | u813371068 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["N,T = map(int,input().split())\nt = 1001\nfor i in range(N) :\n c,t = map( int, input().split() )\n if t<=T:\n m = min(m,c)\n print('TLF' if m==1001 else m)", "N,T = map(int,input().split())\nm = 1001\nfor i in range(N) :\n c,t = map( int, input().split() )\n if t<=T:\n m = min(m,c)\n print('TLE' if m==1001 else m)", "N,T = map(int,input().split())\nm = 1001\nfor i in range(N) :\n c,t = map( int, input().split() )\n if t<=m:\n m = min(m,c)\n print('TLF' if m==1001 else m)", "N,T = map(int,input().split())\nm = 1001\nfor i in range(N) :\n c,t = map( int, input().split() )\n if t<=T:\n m = min(m,c)\n print('TLF' if m==1001 else m)", "N,T = map(int,input().split())\nm = 1001\nfor i in range(N) :\n c,t = map( int, input().split() )\n if t<=T:\n m = min(m,c)\nprint('TLE' if m==1001 else m)"] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s284433075', 's433335440', 's773378908', 's885818161', 's068536598'] | [3060.0, 2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 18.0, 18.0, 18.0, 18.0] | [166, 166, 166, 166, 162] |
p03239 | u814781830 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['N, T = map(int, input().split())\nct = [list(map(int, input().split())) for _ in range(N)]\nret = 10 ** 9\nfor c, t in ct:\n\tif t <= T:\n\t\tret = min(ret, c)\nif ret > 10 ** 9:\n\tprint(ret)\nelse:\n\tprint("TLE")', 'N, T = map(int, input().split())\nct = [list(map(int, input().split())) for _ in range(N)]\nret = 10 ** 9\nfor c, t in ct:\n\tif t <= T:\n\t\tret = min(ret, c)\nif ret < 10 ** 9:\n\tprint(ret)\nelse:\n\tprint("TLE")'] | ['Wrong Answer', 'Accepted'] | ['s478370228', 's276736829'] | [3060.0, 3060.0] | [18.0, 18.0] | [201, 201] |
p03239 | u814986259 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['N,T=map(int,input().split())\nct = [[0,0] for i in range N]\nfor i in range(N):\n ct[i]=list(map(int,input().split()))\nct.append([-1,T])\nct.sort(reverse=True,key=lambda x:x[1])\nindex = ct.index([-1,T])\nif index==0:\n print("TLE")\nelse:\n ans = sorted(ct[:index],key=lambda x:x[0])\n print(ans[0][0])', 'N,T=map(int,input().split())\nct = [[0,0] for i in range(N)]\nfor i in range(N):\n ct[i]=list(map(int,input().split()))\nct.append([-1,T])\nct.sort(key=lambda x:x[1])\nindex = ct.index([-1,T])\nif index==0:\n print("TLE")\nelse:\n ans = sorted(ct[:index],key=lambda x:x[0])\n print(ans[0][0])'] | ['Runtime Error', 'Accepted'] | ['s246416189', 's749843309'] | [2940.0, 3064.0] | [17.0, 18.0] | [297, 285] |
p03239 | u816631826 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["n,t=map(int,input().split())\ncost,time=zip(*list(map(int,input().split()) for i in range(n)))\nans='TLE'\nc=list(cost)\nti=list(time)\nfor i in range(n):\n sc=min(c)\n if ti[c.index(sc)]<=t:\n ans=sc\n break\n else:\n c.pop(c.index(sc))\n\n\n\nprint(ans)", 'N , T = map(int, input().split())\nmini = T\nfor i in range(N):\n c , t = input().split()\nfor i in range(N-1):\n if int(t[i])<mini:\n mini = int(t[i])\nif mini<T:\n print(c[i])\nelse:\n print("TLE")', 'a,b = (input().split())\na = int(a)\nb = int(b)\nroads = []\nfor i in range(a) :\n c , t = input().split()\n t = int(t)\n if t in range (1, b + 1):\n roads.append((int(c) ,t))\n \nif len(roads) == 0 :\n print ("TLE")\nelse:\n roads.sort()\n print (roads[0][0])', "fline = input()\nit, max_time = [int(n) for n in fline.split()]\n\n\ncost_time = []\nfor i in range(it):\n line = input()\n c, t = [int(n) for n in line.split()]\n pair = (c, t)\n cost_time.append(pair)\n\ncost_time.sort(key=lambda x: x[1])\ncost_time2 = []\nfor i in range(it):\n tupl = cost_time[i]\n if(tupl[1]<=max_time):\n cost_time2.append(cost_time[i])\n\ncost_time2.sort(key=lambda x: x[0])\nif(len(cost_time2)==0):\n print('TLE')\nelse:\n el = cost_time2[0]\n print(el[0])"] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s483359033', 's559299163', 's785294673', 's010226842'] | [3064.0, 3060.0, 2940.0, 3064.0] | [17.0, 17.0, 17.0, 18.0] | [270, 209, 270, 492] |
p03239 | u822662438 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['n,t = map(int, input().split())\nli =[]\nfor i in range(n):\n li.append(list(map(int, input().split())))\nprint(li)\n\na =[]\nfor i in range(n):\n if li[i][1] <= t:\n a.append(i)\nprint(a)\nb = []\nfor i in a:\n b.append(li[i][0])\nprint(b)\nif b:\n print(min(b))\nelse:\n print("TLE")\n', 'n,t = map(int, input().split())\nli =[]\nfor i in range(n):\n li.append(list(map(int, input().split())))\n#print(li)\n\na =[]\nfor i in range(n):\n if li[i][1] <= t:\n a.append(i)\n#print(a)\nb = []\nfor i in a:\n b.append(li[i][0])\n#print(b)\nif b:\n print(min(b))\nelse:\n print("TLE")\n'] | ['Wrong Answer', 'Accepted'] | ['s830785363', 's568740359'] | [3064.0, 3060.0] | [17.0, 18.0] | [290, 293] |
p03239 | u841568901 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['N, T = map(int, input().split())\nX = [list(map(int, input().split())) for _ in range(N)]\nY = [X[i] if X[i][1]<=T for i in range(N)]\nprint(Y)', 'N, T = map(int, input().split())\nX = [list(map(int, input().split())) for _ in range(N)]\nY = [x for x in X if x[1]<=T]\nZ = [y[0] for y in Y]\nprint("TLE" if Y==[] else min(Z))'] | ['Runtime Error', 'Accepted'] | ['s880038514', 's543053624'] | [8880.0, 9192.0] | [28.0, 30.0] | [140, 174] |
p03239 | u843932857 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["n,t = int(input().split())\nm = 10000\nfor i in range(n):\n c,d = int(input().split())\n if d <= t:\n if m > c:\n m = c\nif m = 10000:\n print('TLE')\nelse:\n print(m)", "n,t = map(int,input().split())\nm = 10000\nfor i in range(n):\n c,d = map(int,input().split())\n if d <= t:\n if m > c:\n m = c\nif m = 10000:\n print('TLE')\nelse:\n print(m)", "n,t = [x for x in int(input())]\nm = 10000\nfor i in range(n):\n c,d = [x for x in int(input())]\n if d <= t:\n if m > c:\n m = c\nif m = 10000:\n print('TLE')\nelse:\n print(m)", "n,t = map(int,input().split())\nm = 10000\nfor i in range(n):\n c,d = map(int,input().split())\n if d <= t:\n if m > c:\n m = c\nif m == 10000:\n print('TLE')\nelse:\n print(m)"] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s487440599', 's560865752', 's851963621', 's084874725'] | [2940.0, 2940.0, 2940.0, 2940.0] | [18.0, 17.0, 17.0, 17.0] | [187, 195, 197, 196] |
p03239 | u845847173 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['N, T = map(int, input().split())\nc, t = list(map(int, input().split()))\nans = 1001\nfor i in range(N):\n if T > t and c < ans:\n ans = c\n\nif ans == 1000:\n print("TLE")\nelse:\n print(ans)', 'N, T = map(int, input().split())\nc, t = map(int, input().split())\nans = 1001\nfor i in range(N):\n if T > t and c < ans:\n ans = c\n\nif ans == 1000:\n print("TLE")\nelse:\n print(ans)', 'N, T = map(int, input().split())\nc, t = list(map(int, input().split()))\nans = 1000\ni = 0\nfor i in range(N):\n if T > t and c < ans:\n ans = c\n\nif ans == 1000:\n print("TLE")\nelse:\n print(ans)', 'N, T = map(int, input().split())\nc, t = list(map(int, input().split()))\nans = 1001\ni = 0\nfor i in range(N):\n if T > t and c < ans:\n ans = c\n\nif ans == 1000:\n print("TLE")\nelse:\n print(ans)', 'N, T = map(int, input().split())\ni = 0\nans = 1001\nfor i in range(N):\n c, t = map(int, input().split())\n if T >= t and c < ans:\n ans = c\n\nif ans == 1001:\n print("TLE")\nelse:\n print(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s022888834', 's041037538', 's668523838', 's897895576', 's250268599'] | [2940.0, 2940.0, 3060.0, 3060.0, 2940.0] | [17.0, 18.0, 17.0, 18.0, 17.0] | [198, 192, 204, 204, 203] |
p03239 | u846150137 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["I=lambda:map(int,input())\nn,k=I()\ns=1001\nfor i in range(n):\n a,b=I()\n if b<=k:\n s=min(s,a)\nif s==1001:\n print('TLE')\nelse:\n print(s)", "I=lambda:map(int,input().split())\nn,k=I()\ns=1001\nfor i in range(n):\n a,b=I()\n if b<=k:\n s=min(s,a)\nif s==1001:\n print('TLE')\nelse:\n print(s)"] | ['Runtime Error', 'Accepted'] | ['s223780501', 's331412169'] | [2940.0, 2940.0] | [17.0, 17.0] | [139, 147] |
p03239 | u857148155 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['n,t=[int(s)for s in input().split()]\ncost=[]\nfor _ in range(n):\n c,ti=[int(s)for s in input().split()]\n if ti<t:cost.append(c)\nif len(cost)==0:print("TLE")\nelse:\n cs=cost.sorted()\n print(cs[0])', 'n,t=[int(s)for s in input().split()]\ncost=[]\nfor _ in range(n):\n c,ti=[int(s)for s in input().split()]\n if ti<=t:cost.append(c)\nif len(cost)==0:print("TLE")\nelse:\n cs=sorted(cost)\n print(cs[0])'] | ['Runtime Error', 'Accepted'] | ['s220441962', 's890904088'] | [3060.0, 3060.0] | [17.0, 17.0] | [197, 197] |
p03239 | u859897687 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["n,a=map(int,input().split())\nans=100000000\nfor i in range(n):\n c,t=map(int,input().split())\n if t<=a:\n ans=min(ans,c)\nif ans=100000000\n print('TLE')\nelse:\n print(ans)\n", "n,a=map(int,input().split())\nans=100000000\nfor i in range(n):\n c,t=map(int,input().split())\n if t<=a:\n ans=min(ans,c)\nif ans==100000000:\n print('TLE')\nelse:\n print(ans)\n"] | ['Runtime Error', 'Accepted'] | ['s092119514', 's106594128'] | [2940.0, 2940.0] | [18.0, 17.0] | [174, 176] |
p03239 | u863370423 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["def main():\n line = input()\n n, T = [int(x) for x in line.split()]\n lista_tempos = []\n lista_custos = []\n for i in range(n):\n line = input()\n c, t = [int(x) for x in line.split()]\n if t <= T:\n lista_tempos.append(t)\n lista_custos.append(c)\n if lista_tempos:\n print(min(lista_custos))\n else:\n print('TLE')", "n,T=map(int, input().split())\n\nx=[]\n\nfor i in range(n):\n c,t=map(int, input().split())\n if t<=T:\n x.append((i+1,c))\n \nx.sort(key=lambda tup: tup[1])\nif len(x)!=0:\n print(x[0][0])\nelse:\n print('TLE')", 'P,D=input().split()\nc=0\nfor i in range (int(D)):\n dp,b=input().split()\n if int(P)<int(dp) :\n break\n else :\n P=int(P)+int(b)\n c+=1\nif c==int(D) :\n print ("YES")\nelse :\n print ("NO")', 'N, T=map(int, input().split())\n\n\n\nc, aux=[], []\nfor i in range(N):\n\tx, y=map(int, input().split())\n\t\n\tif(y<=T):\n\t\taux=[[int(x), int(y)]]\t\n\t\tc.extend(aux)\n\t\t\t\n\nif (len(c)==0):\n\tprint("TLE")\nelse:\n\taux=min(c)\n\tprint(aux[0])'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s442331951', 's633704311', 's731257787', 's344872830'] | [3064.0, 3060.0, 3060.0, 3064.0] | [17.0, 17.0, 17.0, 17.0] | [382, 224, 216, 277] |
p03239 | u863397945 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['n,lim = map(int,input().split())\n\nans = 10000\n\nfor i in range(n):\n cost,time = map(int,input().split())\n \n if time <= lim and cost < ans:\n ans = cost\n\nif ans != 10000:\n print("TLE")\nelse:\n print(ans)', 'n,lim = map(int,input().split())\n\nans = 10000\n\nfor i in range(n):\n cost,time = map(int,input().split())\n \n if time <= lim and cost < ans:\n ans = cost\n\nif ans == 10000:\n print("TLE")\nelse:\n print(ans)'] | ['Wrong Answer', 'Accepted'] | ['s738143843', 's359542672'] | [9052.0, 9172.0] | [29.0, 32.0] | [221, 221] |
p03239 | u865413330 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['n, t = map(int, input().split())\nl = [input().split() for i in range(n)]\nl.sort()\nexist = False\n\nfor i in l:\n if int(i[1]) < t:\n print(i[0])\n exist = True\n break\nif !(exist):\n print("TLE")', 'n, t = map(int, input().split())\nl = [list(map(int, input().split())) for i in range(n)]\nl.sort()\nexist = False\n\nfor i in l:\n if int(i[1]) <= t:\n print(i[0])\n exist = True\n break\nif not exist:\n print("TLE")'] | ['Runtime Error', 'Accepted'] | ['s160323763', 's812370637'] | [2940.0, 3060.0] | [17.0, 17.0] | [199, 217] |
p03239 | u886112691 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["N=int(input())\nT=int(input())\ncheck=1\nansc=1001\n\nfor i in range(N):\n c=int(input())\n t=int(input())\n\n if t<T and c<ansc:\n ansc=c\n T=t\n check=0\n\nif check==0:\n print(ansc)\nelse:\n print('TLE')", "N,T=map(int,input().split())\n\nC=[]\n\nfor i in range(N):\n c,t=map(int,input().split())\n\n if t<=T:\n C.append(c)\n\nif not C:\n print('TLE')\nelse:\n print(min(C))"] | ['Runtime Error', 'Accepted'] | ['s991942966', 's270788284'] | [3060.0, 2940.0] | [17.0, 18.0] | [225, 173] |
p03239 | u895730552 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['\nn,t = (int(x) for x in input().split())\n\nA = []\nfor i in range(n):\n c,ti = (int(x) for x in input().split())\n A.append([c,ti])\n\nB = []\nfor i in A:\n if A[1] < t:\n B.append(i)\n\nif len(B):\n B.sort(key=lambda x: x[0])\n print(B[0])\nelse:\n print("TLE")', '# -*- coding: utf-8 -*-\n\nn,t = (int(x) for x in input().split())\n\nA = []\nfor i in range(n):\n c,ti = (int(x) for x in input().split())\n A.append([c,ti])\n\nA.sort(key=lambda x: x[1])\n\nif A[0][1] > t:\n print("TLE")\nelse:\n min = A[0][0]\n for i in A:\n if i[1] > t:\n break\n \n if min > i[0]:\n min = i[0]\n \n print(min)'] | ['Runtime Error', 'Accepted'] | ['s828135623', 's764122824'] | [3064.0, 3064.0] | [17.0, 17.0] | [275, 380] |
p03239 | u895741336 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["NT = list(map(int, input().split()))\nN = NT[0]\nT = NT[1]\nl = []\nfor i in range(N):\n l.append(list(map(int, input().split())))\n\nlf = list(filter(lambda x: x[1] <= T, l))\n\nif(len(lf) == 0):\n print('TLE')\nelse:\n ls = sorted(lf, key=lambda x: x[0])\n print(l.index(ls[0]) + 1)", "NT = list(map(int, input().split()))\nN = NT[0]\nT = NT[1]\nl = []\nfor i in range(N):\n l.append(list(map(int, input().split())))\n\nlf = list(filter(lambda x: x[1] <= T, l))\n\nif(len(lf) == 0):\n print('TLE')\nelse:\n ls = sorted(lf, key=lambda x: x[0])\n print(ls[0][0])"] | ['Wrong Answer', 'Accepted'] | ['s820008519', 's471378978'] | [3064.0, 3064.0] | [17.0, 18.0] | [283, 273] |
p03239 | u899645116 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['N,T = int(x) for x in input().split()\nC = 2000\nfor i in range(N):\n c,t = int(x) for x in input().split()\n if t <= T:\n C = min(c,C)\n \nif C == 2000:\n print("TLE")\nelse: print(C)\n', 'N,T = int(input().split())\nC = 2000\nfor i in range(N):\n c,t = int(input().split())\n if t <= T:\n C = min(c,C)\n \nif C == 2000:\n print("TLE")\nelse: print(C)', 'N,T = (int(x) for x in input().split())\nC = 2000\nfor i in range(N):\n c,t = (int(x) for x in input().split())\n if t <= T:\n C = min(c,C)\n \nif C == 2000:\n print("TLE")\nelse: print(C)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s696076787', 's914410896', 's097401545'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [185, 162, 189] |
p03239 | u905582793 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["N,T=map(int,input().split())\nls=[int(input()) for _ in range(N)]\nans='TLE'\nfor c,t in ls:\n if t <= T:\n ans = min(ans,c)\n \nprint(ans)", "N,T=map(int,input().split())\nls=[int(input()) for _ in range(N)]\nans=10**18\nfor i in ls:\n if i[0] <= T:\n ans = min(ans,i[1])\nif ans < 10**18:\n print(ans)\nelse:\n print('TLE')\n", "N,T=map(int,input().split())\nls=[int(input()) for _ in range(N)]\nans=10**18\nfor i in ls:\n if i[1] <= T:\n ans = min(ans,i[0])\nif ans < 10**18:\n print(ans)\nelse:\n print('TLE')\n", "N,T=map(int,input().split())\nls=[int(input()) for _ in range(N)]\nans=10**18\nfor c,t in ls:\n if t <= T:\n ans = min(ans,c)\nif ans < 10**18:\n print(ans)\nelse:\n print('TLE')", "N,T=map(int,input().split())\nls=[list(map(int,input().split())) for _ in range(N)]\nans=10**18\nfor i in ls:\n if i[1] <= T:\n ans = min(ans,i[0])\nif ans < 10**18:\n print(ans)\nelse:\n print('TLE')\n"] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s070544782', 's473911881', 's558396378', 's822057514', 's884067702'] | [3056.0, 3056.0, 3056.0, 3060.0, 3060.0] | [17.0, 17.0, 18.0, 17.0, 18.0] | [139, 180, 180, 175, 198] |
p03239 | u912833927 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["n, T = map(int, input.split())\nres = 2000\nfor _ in range(n):\n c, t = map(int, input.split())\n if t > T: continue\n res = min(res, c)\nif res == 2000:\n print('TLE')\nelse:\n print(res)", "n, T = map(int, input().split())\nres = 2000\nfor _ in range(n):\n c, t = map(int, input().split())\n if t > T: continue\n res = min(res, c)\nif res == 2000:\n print('TLE')\nelse:\n print(res)"] | ['Runtime Error', 'Accepted'] | ['s901466386', 's947370052'] | [2940.0, 2940.0] | [17.0, 17.0] | [184, 188] |
p03239 | u914797917 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["N,T = map(int,input().split())\nci = []\nti = []\nfor i in range(N):\n c, t = input().split()\n ci.append(int(c))\n ti.append(int(t))\n\n#print(ci,ti)\n\nlowest=1000\n\nfor i in range(N):\n if ti[i]<=T and ci[i]<=lowest:\n lowest=ci[i]\nif max(ti)>T:\n print('TLE')\nelse:\n print(lowest)\n ", "N,T = map(int,input().split())\nci = []\nti = []\nfor i in range(N):\n c, t = input().split()\n ci.append(int(c))\n ti.append(int(t))\n\n#print(ci,ti)\n\nlowest=1000\n\nif min(ti)>T:\n print('TLE')\nelse:\n for i in range(N):\n if ti[i]<=T and ci[i]<=lowest:\n lowest=ci[i]\n print(lowest)\n "] | ['Wrong Answer', 'Accepted'] | ['s557090042', 's467703488'] | [3064.0, 3060.0] | [18.0, 17.0] | [282, 288] |
p03239 | u918601425 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['N,K=[int(s) for s in input().split()]\nm=10000\nn=10000\nfor i in range(N):\n a,b=[int(s) for s in input().split()]\n if b<K:\n n=min([n,a])\nif m==10000:\n print("TLE")\nelse:\n print(a)\n ', 'N,K=[int(s) for s in input().split()]\nn=10000\nfor i in range(N):\n a,b=[int(s) for s in input().split()]\n if b<=K:\n n=min([n,a])\nif n==10000:\n print("TLE")\nelse:\n print(n)\n \n'] | ['Wrong Answer', 'Accepted'] | ['s240057405', 's019355354'] | [3064.0, 2940.0] | [18.0, 17.0] | [189, 183] |
p03239 | u921563073 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['# -*- coding: utf-8 -*-\nn,t = map(int,input().split())\nans_no = 0\nans_cost = t\n\nfor i in range(n):\n a,b = map(int,input().split())\n if b<ans_cost:\n ans_no = a\n\nif ans_no = 0:\n print("TLE")\nelse print(ans_no)', '# -*- coding: utf-8 -*-\nn,t = map(int,input().split())\nans_cost = float(\'inf\')\nans_time = t\n\nfor i in range(n):\n a,b = map(int,input().split())\n if b=ans_time:\n if a<ans_cost:\n ans_cost = a\n\n\nif ans_cost == float(\'inf\'):\n print("TLE")\nelse:\n print(ans_cost)', '# -*- coding: utf-8 -*-\nn,t = map(int,input().split())\nans_cost = 10000\nans_time = t\n\nfor i in range(n):\n a,b = map(int,input().split())\n if b<=ans_time:\n if a<ans_cost:\n ans_cost = a\n\n\nif ans_cost == 10000:\n print("TLE")\nelse:\n print(ans_cost)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s509813038', 's797651871', 's880682213'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 18.0] | [223, 288, 276] |
p03239 | u922449550 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["N, T = map(int, input().split())\nans = 'TLE'\ncost = float('inf')\n\nfor i in range(N):\n c, t = map(int, input().split())\n if t <= T:\n ans = min(ans, c)\n\nprint(ans)", "N, T = map(int, input().split())\nans = float('inf')\ncost = float('inf')\n\nfor i in range(N):\n c, t = map(int, input().split())\n if t <= T:\n ans = min(ans, c)\n\nif ans < float('inf'):\n print(ans)\nelse:\n print('TLE')\n"] | ['Runtime Error', 'Accepted'] | ['s414808417', 's375087547'] | [2940.0, 2940.0] | [18.0, 18.0] | [166, 220] |
p03239 | u928784113 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['N,T = map(int,input().split())\na= [map(int,input().split()) for i in range(N)]\nb = []\nfor i in range(N):\n b.append(a[i][0])\nL = sorted(b)\ni = 0\nwhile i < N:\n if L[i] < T:\n print(L[i])\n break\n else:\n i = i+1\n continue\nif i == N:\n print("TLE")', 'N,T = map(int,input().split())\nfor i in range(N):\n c,t = list(map(int,input()))\na = 1000\nfor i in range(N):\n if t <= T:\n a = min(a,c)\nif a = 1000:\n print("TLE")\nelse:\n print(a)', 'N,T = map(int,input().split())\nfor i in range(N):\n dic = {int(input()):int(input())}\na = sorted(dic.get())\nfor i in range(N):\n if dic[a[i]] <= T:\n print(a[i])\n else:\n continue', 'N,T = map(int,input().split())\nc,t = [map(int,input()) for i in range(N)]\na = 1000\nfor i in range(N):\n if t <= T:\n a = min(a,c)\nif a = 1000:\n print("TLE")\nelse:\n print(a)', 'N,T = map(int,input().split())\ndic = {}\nfor i in range(N):\n dic[int(input())] = int(input())\nL = sorted(dic.dict_keys)\nfor i in range(N):\n if dic[i] <T:\n print(L[i])\n break\nprint("TLE")', 'N,T = map(int,input().split())\nfor i in range(N):\n c,t = map(int,input())\na = 1000\nfor i in range(N):\n if t <= T:\n a = min(a,c)\nif a = 1000:\n print("TLE")\nelse:\n print(a)', 'N,T = map(int,input().split())\n\nct = [list(map(int,input().split())) for i in range(N)]\n\nc = []\nt = []\n\nfor i in range(N):\n c.append(ct[i][0])\n t.append(ct[i][1])\n\nminc = 10000\n\nfor i in range(len(c)):\n if t[i] <= T and c[i] < minc:\n minc = c[i]\n\nif minc == 10000:\n print("TLE")\nelse:\n print(minc)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s074034251', 's202967417', 's236978327', 's392822361', 's611897443', 's653147446', 's741947154'] | [3064.0, 2940.0, 3060.0, 2940.0, 3316.0, 3068.0, 3064.0] | [18.0, 18.0, 18.0, 19.0, 22.0, 18.0, 21.0] | [281, 183, 185, 176, 205, 177, 319] |
p03239 | u934868410 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['n,T = map(int, input())\nans = 1000\nfor i in range(n):\n c,t = map(int, input())\n if t <= T:\n ans = min(ans, c)\nprint(ans)', 'n,T = map(int, input().split())\nans = 1001\nfor i in range(n):\n c,t = map(int, input().split())\n if t <= T:\n ans = min(ans, c)\n\nif ans == 1001:\n print("TLE")\nelse:\n print(ans)'] | ['Runtime Error', 'Accepted'] | ['s903772257', 's429372456'] | [2940.0, 2940.0] | [17.0, 17.0] | [125, 181] |
p03239 | u940279019 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["N,T = map(int,input().split())\nc,t = [list(map(int,input.split())) for i in N]\nmin_c = 1000\nhantei = 0\nans = 0\nfor i in N:\n tmp = 0\n if t[i] <= T:\n tmp = 1\n hantei += 1\n if tmp == 1:\n if c[i] < min_c:\n min_c = c[i]\n ans = i+1\nprint ans if hantei>0 else 'TLE' ", 'N,T = map(int,input().split())\nc,t = [list(map(int,input.split())) for i in N]\nmin_c = 1000\nhantei = 0\nans = 0\nfor i in N:\n tmp = 0\n if t[i] <= T:\n tmp = 1\n hantei += 1\n if tmp == 1:\n if c[i] < min_c:\n min_c = c[i]\n ans = i+1\nprint(ans) ', "N,T = map(int,input().split())\nc = []\nfor i in range(N):\n ci,ti = map(int,input().split())\n c.append([ci,ti])\n\nc.sort(key=lambda x:x[0])\nfor i in range(N):\n if c[i][1] <= T:\n print( c[i][0])\n exit()\nprint('TLE')"] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s899980097', 's910593088', 's890146575'] | [3064.0, 3064.0, 3060.0] | [17.0, 18.0, 18.0] | [282, 262, 220] |
p03239 | u944209426 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['n,t=map(int,input().split())\nct=[list(map(int,input().split())) for _ in range(n)]\nmc=100000\nfor i in range(n):\n if ct[i][1]<=t:\n if ct[i][0]<mc:\n mc=ct[i][0]\nif mi==-1:\n print("TLE")\nelse:\n print(mc)', 'n,t=map(int,input().split())\nct=[list(map(int,input().split())) for _ in range(n)]\nmc=100000\nfor i in range(n):\n if ct[i][1]<=t:\n if ct[i][0]<mc:\n mc=ct[i][0]\nif mc==100000:\n print("TLE")\nelse:\n print(mc)'] | ['Runtime Error', 'Accepted'] | ['s259351056', 's792215707'] | [3064.0, 3060.0] | [17.0, 18.0] | [227, 231] |
p03239 | u946424121 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['n, T = map(int, input().split())\na = 1001\nfor i in range(n):\n c, t = map(int, input().split())\n if t < T:\n a = min(a.c)\nif a == 1001:\n print("TLE")\nelse:\n print(a)', 'n, T = map(int, input().split())\na = 1001\nfor i in range(n):\n c, t = map(int, input().split())\n if t <= T:\n a = min(a,c)\nif a == 1001:\n print("TLE")\nelse:\n print(a)'] | ['Runtime Error', 'Accepted'] | ['s559616563', 's723950763'] | [2940.0, 2940.0] | [17.0, 18.0] | [170, 183] |
p03239 | u947617358 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["n,T=map(int,input().strip().split())\narr=[]\nfor _ in range(n):\n c,t=map(int,input().strip().split())\n arr.append((c,t))\narr=sorted(arr,key=lambda x:x[0])\nflag=True\nfor a,b in arr:\n if b<=T:\n print(a)\n break\n else:\n flag=False \nif flag==False:\n print('TLE')\n \n", "n,T=map(int,input().strip().split())\narr=[]\nfor _ in range(n):\n c,t=map(int,input().strip().split())\n arr.append((c,t))\narr=sorted(arr,key=lambda x:x[0])\nflag=True\nfor a,b in arr:\n if b<=T:\n flag=True\n print(a)\n break\n else:\n flag=False \nif flag==False:\n print('TLE')\n \n"] | ['Wrong Answer', 'Accepted'] | ['s267640240', 's710045429'] | [3060.0, 3060.0] | [17.0, 17.0] | [298, 316] |
p03239 | u951601135 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["N,T=map(int,input().split())\nli = [list(map(int,input().split())) for i in range(N)]\nt_cost=[T - li[i][1] for i in range(N)]\nif(all(x < 0 for x in t_cost)):\n print('TLE')\nelse:\n t_cost_1=[]\n for i in range(N):\n if(t_cost[i]>=0):\n t_cost_1.append(i)\n else:\n print(min([li[t_cost_1[i]][0] for i in range(len(t_cost_1))]))", "N, T = map(int, input().split())\nresult = 1001\nfor _ in range(N):\n c, t = map(int, input().split())\n if t <= T:\n result = min(result, c)\n\nif (result == 1001):\n print('TLE') \nelse:\n print(result)"] | ['Runtime Error', 'Accepted'] | ['s189351024', 's999554518'] | [3060.0, 3060.0] | [20.0, 18.0] | [334, 213] |
p03239 | u959759457 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["N,T=map(int,input().split())\nm=1001\nfor i in range(N):\n c,t=map(int,input().split())\n if t<=T:\n m=min(m,c)\nif m==1001:\n print('TLE')", "N,T=map(int,input().split())\nm=1001\nfor i in range(N):\n c,t=map(int,input().split())\n if t<=T:\n m=min(m,c)\n \nif m==1001:\n print('TLE')\nelse:\n print(m)\n \n "] | ['Wrong Answer', 'Accepted'] | ['s548934804', 's225395879'] | [2940.0, 2940.0] | [18.0, 17.0] | [148, 186] |
p03239 | u963903527 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['n,t = map(int, input().split())\nl = []\nfor _ in range(n):\n i, c = map(int, input().split())\n if not c => j:\n l.append([c, j])\nl.sort(key=lambda x: x[1])\nprint(l[0][0])', "N,T = map(int, input().split())\nl = []\nfor i in range(N):\n c, t = map(int, input().split())\n if not t > T:\n l.append([i+1, c])\nif l == []:\n print('TLE'); exit()\nl.sort(key=lambda x: x[1])\nprint(l[0][1])"] | ['Runtime Error', 'Accepted'] | ['s042817448', 's357106403'] | [2940.0, 3060.0] | [17.0, 17.0] | [172, 210] |
p03239 | u978313283 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ["N,T=map(int,input().split())\na=[]\nfor i in range(N):\n c,t=map(int,input().split())\n if t<=T:\n a.append(c)\nif len(a)==0:\n print('TLE')\nelse:\n a.sort()\n print(a[0][0])\n", "N,T=map(int,input().split())\na=[]\nfor i in range(N):\n c,t=map(int,input().split())\n if t<=T:\n a.append(c)\nif len(a)==0:\n print('TLE')\nelse:\n a.sort()\n print(a[0])\n"] | ['Runtime Error', 'Accepted'] | ['s458680607', 's418411922'] | [2940.0, 2940.0] | [18.0, 18.0] | [188, 185] |
p03239 | u987164499 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['from sys import stdin\nimport bisect\n\nn,t = [int(x) for x in stdin.readline().rstrip().split()]\nli = [list(map(int,stdin.readline().rstrip().split())) for _ in range(n)]\nli2 = []\nfor i in range(n):\n if li[i][0] <= t:\n li2.append(li[i][0])\n\nli2.sort()\n\nprint(li2[0])', 'from sys import stdin\nimport bisect\n\nn,t = [int(x) for x in stdin.readline().rstrip().split()]\nli = [list(map(int,stdin.readline().rstrip().split())) for _ in range(n)]\nli2 = []\nfor i in range(n):\n if li[i][1] <= t:\n li2.append(li[i][0])\nif len(li2) == 0:\n print("TLE")\n exit()\nli2.sort()\nprint(li2[0])'] | ['Runtime Error', 'Accepted'] | ['s368617937', 's111338829'] | [3060.0, 3064.0] | [18.0, 18.0] | [274, 318] |
p03239 | u989306199 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['N, T = map(int, input().split())\nans = 1000000\nfor i in range(N):\n c, t = map(int, input().split())\n if t <= T:\n ans = min(ans, c)\nprint(ans if ans < T else "TLE")\n', 'N, T = map(int, input().split())\nans = 1000000\nfor i in range(N):\n c, t = map(int, input().split())\n if t <= T:\n ans = min(ans, c)\nprint("TLE" if ans == 1000000 else ans)\n'] | ['Runtime Error', 'Accepted'] | ['s848252244', 's732362891'] | [2940.0, 2940.0] | [17.0, 18.0] | [173, 184] |
p03239 | u993622994 | 2,000 | 1,048,576 | When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i. Find the smallest cost of a route that takes not longer than time T. | ['n = int(input())\nh = list(map(int, input().split()))\nans = 1\n\nfor i in range(1, n):\n if max(h[:i]) <= h[i]:\n ans += 1\n\nprint(ans)', "n, t = map(int, input().split())\nct = [list(map(int, input().split())) for _ in range(n)]\nans = []\n\nfor i in ct:\n if i[1] <= t:\n ans.append(i)\n\nif not ans:\n print('TLE')\nelse:\n ans.sort(key=lambda x: x[0])\n print(ans[0][0])"] | ['Runtime Error', 'Accepted'] | ['s000933358', 's007313137'] | [2940.0, 3060.0] | [17.0, 18.0] | [139, 242] |
p03241 | u001024152 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['from math import sqrt, ceil\nimport sys\n\nN, M = map(int, input().split())\nrootM = max(ceil(sqrt(M)), M//N)\n\nfor m in reversed(range(1, rootM+1)):\n if M % m == 0:\n print(m)\n if M // m >= N:\n print(m)\n sys.exit()', 'from math import sqrt, floor\n \nN, M = map(int,input().split())\n \nrootM = floor(sqrt(M))\nl = []\nfor i in range(1, rootM +1):\n if M % i == 0:\n l.append(i)\n l.append(M//i)\n \nans = 1\nfor li in l:\n ans = max(ans, li) if li <= M // N else ans\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s766429339', 's897768782'] | [3060.0, 3064.0] | [2104.0, 21.0] | [248, 274] |
p03241 | u020604402 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N ,M = map(int,input().split())\nans = 0\nfor i in range(1,int(M**(1/2)+1)):\n if M % i == 0:\n ans = max(ans,i)\n ans = max(ans,M//i)\nprint(ans)', 'N ,M = map(int,input().split())\nL = []\nans = 0\nfor i in range(1,int(M**(1/2)+1)):\n if M % i == 0:\n if i >= N: ans = max(ans,i)\n if M // i >= N: ans = max(ans,M//i)\nprint(ans)\n', 'N ,M = map(int,input().split())\nL = []\nans = 0\nfor i in range(1,int(M**(1/2)+1)):\n if M % i == 0:\n if i >= N: ans = max(ans,M//i)\n if M // i >= N: ans = max(ans,i)\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s416316230', 's952436851', 's946882234'] | [3060.0, 3060.0, 3060.0] | [21.0, 21.0, 21.0] | [157, 192, 192] |
p03241 | u022979415 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ["from fractions import gcd\n\n\ndef main():\n n, m = map(int, input().split())\n print(gcd(m, m // n))\n\n\nif __name__ == '__main__':\n main()\n\n", "def main():\n n, m = map(int, input().split())\n f = [1, m]\n i = 2\n while i * i <= m:\n if m % i == 0:\n f.append(i)\n if m != i * i:\n f.append(m // i)\n i += 1\n f.sort()\n answer = 0\n for ff in f:\n if n <= ff:\n answer = m // ff\n break\n print(answer)\n\n\nif __name__ == '__main__':\n main()\n\n"] | ['Wrong Answer', 'Accepted'] | ['s571826369', 's105887809'] | [5304.0, 3060.0] | [39.0, 22.0] | [144, 389] |
p03241 | u026075806 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N, M = map(int, input().split())\ncand = M // N\n\nwhile cand > 0:\n print(cand)\n if M % cand == 0:\n #print(cand)\n exit()\n cand -= 1', 'def enum_divisors(n, reverse=False):\n divisors = []\n for i in range(1, int(math.sqrt(n)) ):\n if n % i == 0:\n divisors.append(i)\n if i != 1 and i * i != n:\n divisors.append(n//i)\n return sorted(divisors, reverse=reverse)\n\ndivisors = enum_divisors(M, reverse=True)\ndivisors = filter(lambda x: x <= M//N, divisors)\n\nfor cand in divisors:\n if M % cand == 0:\n print(cand)\n exit()', 'import math\nN, M = map(int, input().split())\n\ndef enum_divisors(n, reverse=False):\n divisors = []\n for i in range(1, int(math.sqrt(n)) ):\n if n % i == 0:\n divisors.append(i)\n if i != 1 and i * i != n:\n divisors.append(n//i)\n return sorted(divisors, reverse=reverse)\n\n\ndivisors = enum_divisors(M, reverse=True)\nprint()\ndivisors = filter(lambda x: x <= M//N, divisors)\n\ncand = M // N\n\nfor cand in divisors:\n if M % cand == 0:\n print(cand)\n exit()', 'import math\nN, M = map(int, input().split())\n \ndef enum_divisors(n, reverse=False):\n divisors = []\n for i in range(1, int(math.sqrt(n)) + 1 ):\n if n % i == 0:\n divisors.append(i)\n divisors.append(n//i)\n return sorted(divisors, reverse=reverse)\n \n \ndivisors = enum_divisors(M, reverse=True)\ndivisors = list(filter(lambda x: x <= M//N, divisors))\n\nprint(divisors[0])'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s139524776', 's570306810', 's582041127', 's082423292'] | [24932.0, 3060.0, 3064.0, 3064.0] | [2104.0, 17.0, 20.0, 20.0] | [151, 444, 514, 402] |
p03241 | u026155812 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import bisect\nimport sys\nN, M = map(int, input().split())\nls = []\nfor i in range(1, int(M**(1/2))+1):\n if M%i == 0:\n ls.append(i)\nans = []\nfor x in ls:\n ans.append(x)\n ans.append(M//x)\nprint(ans[bisect.bisect_left(ans, N)])', 'import bisect\nN, M = map(int, input().split())\nls = []\nfor i in range(2, int(M**(1/2))+1):\n if M%i == 0:\n ls.append(i)\nans = 1\nfor x in ls:\n if M//x <= N:\n ans = max(ans, x)\nprint(ans)', 'import sys\nN, M = map(int, input().split())\nls = []\nfor i in range(2, int(M**(1/2))+1):\n if M%i == 0:\n ls.append(i)\nif N == 1:\n print(M)\n sys.exit()\nans = 1\nfor x in ls:\n if x >= N:\n ans = max(ans, M//x)\n continue\n if M//x >= N:\n ans = max(ans, x)\nprint(ans)'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s413333842', 's650206310', 's097544315'] | [3060.0, 3064.0, 3064.0] | [21.0, 21.0, 21.0] | [239, 204, 301] |
p03241 | u026788530 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\nlis = []\n\nN,M = [int(i) for i in input().split()]\nM_ = M\ni = 2\nfor i in range(1,int(math.sqrt(M))):\n if M % i == 0:\n lis.append(i)\n lis.append(M//i)\n\nlis.sort()\nret = 0\nfor i in lis:\n if i > N:\n break\n ret = i\n\nprint(M_//ret )\n', '\nlis = []\n\nN,M = [int(i) for i in input().split()]\nM_ = M\ni = 2\n\nwhile True:\n if M % i == 0:\n M = M // i\n lis.append(i)\n elif M == 1:\n break\n else:\n i += 1\nans = M_\n\nfor n in range(2**len(lis)):\n m = bin(n)[-1:1:-1]\n ret = 1\n for l in range(len(m)):\n if int(m[l]):\n ret *= lis[l]\n if ret >= N:\n break\n if ret >= N and N <=ans:\n ans = ret\n\nprint(M_//ans)\n', '\nlis = []\n\nN,M = [int(i) for i in input().split()]\nM_ = M\ni = 2\n\nwhile True:\n if M % i == 0:\n M = M // i\n lis.append(i)\n elif M == 1:\n break\n else:\n i += 1\nans = M_\n\nprint(lis)\nfor n in range(2**len(lis)):\n m = bin(n)[-1:1:-1]\n ret = 1\n # print(m)\n for l in range(len(m)):\n if int(m[l]):\n ret *= lis[l]\n # print(lis[l])\n if ret > N:\n break\n if ret >= N:\n #print(ret)\n ans = min(ans,ret)\n\nprint(M_//ans)', 'import math\nlis = []\n\nN,M = [int(i) for i in input().split()]\n\nfor i in range(1,int(math.sqrt(M))):\n if M % i == 0:\n lis.append(i)\n lis.append(M//i)\n\n\nlis.sort()\nfor i in lis:\n if i >= N:\n break\n\nprint(M//i3 )\n', '\nlis = []\n\nN,M = [int(i) for i in input().split()]\nM_ = M\ni = 2\n\nwhile True:\n if M % i == 0:\n M = M // i\n lis.append(i)\n elif M == 1:\n break\n else:\n i += 1\nans = M_\nret = 1\nfor n in range(2**len(lis)):\n m = bin(n)[-1:1:-1]\n ret = 1\n for l in range(len(m)):\n if int(m[l]):\n ret *= lis[l]\n if ret >= N:\n break\n if ret <=ans:\n ans = ret\n\nprint(M_//ans)\n', 'import math\nlis = []\n\nN,M = [int(i) for i in input().split()]\n\nfor i in range(1,int(math.sqrt(M))):\n if M % i == 0:\n lis.append(i)\n\n\nret = 0\nfor i in lis:\n\n ret = i\n if i >= N:\n break\n\nprint(M//ret )\n', 'import math\nlis = []\n\nN,M = [int(i) for i in input().split()]\n\nfor i in range(1,int(math.sqrt(M))):\n if M % i == 0:\n lis.append(i)\n lis.append(M//i)\n\n\nlis.sort()\ni =1\nfor i in lis:\n if i >= N:\n break\n\nprint(M//i )\n'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s015210867', 's109666369', 's118561035', 's222865682', 's391373482', 's952446644', 's183975941'] | [3064.0, 3064.0, 3064.0, 3060.0, 3064.0, 3060.0, 3060.0] | [23.0, 2104.0, 2103.0, 21.0, 2104.0, 21.0, 21.0] | [270, 455, 522, 238, 451, 224, 242] |
p03241 | u036340997 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n, m = map(int, input().split())\n\nans = 1\nfor i in range(1, int(m**0.5)+2):\n if i * n <= m:\n ans = max(ans, i)\n if (m // i) * n <= m:\n ans = max(ans, m//i)\n \nprint(ans)', 'n, m = map(int, input().split())\n\nans = 1\nfor i in range(1, int(m**0.5)+2):\n if m % i == 0:\n if i * n <= m:\n ans = max(ans, i)\n if (m // i) * n <= m:\n ans = max(ans, m//i)\n \nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s518555077', 's821252206'] | [3060.0, 3060.0] | [42.0, 21.0] | [179, 204] |
p03241 | u037430802 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n,m = map(int, input().split()) \n\ni = 1\nans = 1\nwhile i * i <= m:\n if m % i == 0:\n if i >= n:\n if i >= n:\n ans = max(ans, m // i)\n elif m // i >= n:\n ans = max(ans(ans, i))\n \n i += 1\n \n \nprint(ans)', 'def is_prime(q):\n q = abs(q)\n if q == 2: return True\n if q < 2 or q&1 == 0: return False\n return pow(2, q-1, q) == 1\n\nn,m = map(int, input().split())\n \nif m % n == 0:\n print(m//n)\n exit()\n \nelif is_prime(m):\n print(1)\n \nelse:\n i = 1\n ans = 0\n while i * i <= m:\n if (m - i * n) % i == 0:\n ans = i\n break\n i += 1\n\n print(ans)', 'n,m = map(int, input().split()) \n\ni = 1\nans = 0\nwhile i * i <= m:\n if m % i == 0:\n if i >= n:\n if i >= n:\n ans = max(ans, m // i)\n else m // i >= n:\n ans = max(ans(ans, i))\n \n \nprint(ans)', 'import math\n\nN, M = map(int, input().split())\n\nif M % N == 0:\n print(M//N)\n exit()\n\nans = 1\nfor i in reversed(range(1, int(M ** 0.5)+1)):\n \n rest = M - (i * N)\n if (i+rest) % i == 0:\n ans = i\n \nprint(ans)\n', 'n,m = map(int, input().split()) \n\ni = 1\nans = 0\nwhile i * i <= m:\n if m % i == 0:\n if i >= n:\n if i >= n:\n ans = max(ans, m // i)\n else m // i >= n:\n ans = max(ans(ans, i))\n \n \nprint(ans)', 'n,m = map(int, input().split()) \n\ni = 1\nans = 1\nwhile i * i <= m:\n if m % i == 0:\n if i >= n:\n if i >= n:\n ans = max(ans, m // i)\n elif m // i >= n:\n ans = max(ans(ans, i))\n \n \nprint(ans)', 'N, M = map(int, input().split())\n\nif M % N == 0:\n print(M//N)\n exit()\n\n\n\npn = 2\nis_prime = True\nwhile pn*pn <= M:\n if M % pn == 0:\n \n is_prime = False\n break\n pn += 1\n\n\nif is_prime == False:\n ans = 1\n for i in reversed(range(1, (M**0.5)+1)):\n \n rest = M - (i * N)\n if (i+rest) % i == 0:\n ans = i\n break\nelse:\n if N == 1:\n ans = M\n else:\n ans = 1\n\nprint(ans) ', 'import math\n\nN, M = map(int, input().split())\n\nif M % N == 0:\n print(M//N)\n exit()\n\nans = 1\nfor i in range(1, math.ceil(M ** 0.5)):\n if M % i == 0:\n if i*N <= M:\n ans = max(ans, i)\n if (M//i)*N <= M:\n ans = max(ans, M//i) \n\n\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Time Limit Exceeded', 'Runtime Error', 'Accepted'] | ['s269992081', 's396391146', 's541329926', 's638136777', 's680797380', 's786849632', 's949159361', 's664176571'] | [3064.0, 3064.0, 2940.0, 3060.0, 2940.0, 3060.0, 3188.0, 3188.0] | [27.0, 19.0, 17.0, 29.0, 17.0, 2107.0, 24.0, 21.0] | [235, 362, 217, 264, 217, 217, 623, 280] |
p03241 | u044952145 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import sys\n\nN, M = map(int, input().split())\n\nfor i in range(int(math.sqrt(M))+1, 1, -1):\n if M % i == 0:\n if M >= N*i:\n print(i)\n sys.exit()', 'import sys\nInput = sys.stdin.readline\n\nN, M = map(int, Input().split())\n\nfor i in range(int(math.sqrt(M))+1, 1, -1):\n if M % i == 0:\n if M >= N*i:\n print(i)\n sys.exit()', 'import sys\nimport math\nInput = sys.stdin.readline\n \nN, M = map(int, Input().split())\nD = []\n \nfor i in range(int(math.sqrt(M)), 0, -1):\n if M % i == 0:\n D.append(i)\n D.append(M // i)\n\nD.sort(reverse=True)\nfor d in D:\n if M >= N*d:\n print(d)\n break'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s236049034', 's350070188', 's454360418'] | [2940.0, 2940.0, 3064.0] | [17.0, 18.0, 21.0] | [173, 200, 277] |
p03241 | u050138914 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import sys\nn,m=map(long,input().split())\nif n==1:\n print(m)\n sys.exit()\nans=[]\ni=1\nwhile i<=m/i:\n if m%i:\n i=i+1\n else:\n j=m/i\n if j>=n:\n ans.append(i)\n if i>=n:\n ans.append(j)\n i=i+1\nans.sort()\nprint(ans[len(ans)-1])', 'import sys\nn,m=map(int,input().split())\nif n==1:\n print(m)\n sys.exit()\nans=[]\ni=int(1)\nwhile i<=m/i:\n if m%i!=0:\n i+=1\n elif m%i==0:\n j=int(m/i)\n if j>=n:\n ans.append(i)\n if i>=n:\n ans.append(j)\n i+=1\nans.sort()\nprint(ans[len(ans)-1])'] | ['Runtime Error', 'Accepted'] | ['s717195593', 's082037209'] | [3064.0, 3064.0] | [17.0, 29.0] | [286, 303] |
p03241 | u050698451 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N, M = map(int, input().split())\nd = []\nfor i in range(M, int(M**0.5)+1,-1):\n\tif M%i == 0:\n\t\td.append(i)\n\t\td.append(M/i)\nd.sort(reverse=True)\nfor i in range(len(d)):\n\tif d[i] <= M/N:\n\t\tprint(d[i])\n\t\texit()\n', 'N, M = map(int, input().split())\nd = []\nfor i in range(1, int(M**0.5)+1):\n\tif M%i == 0:\n\t\td.append(i)\n\t\td.append(M//i)\nd.sort()\nfor i in range(1,len(d)+1):\n\tif d[-i] <= M//N:\n\t\tprint(d[-i])\n\t\texit()\n'] | ['Wrong Answer', 'Accepted'] | ['s555879263', 's330822680'] | [2940.0, 3060.0] | [2104.0, 21.0] | [206, 199] |
p03241 | u052499405 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\nn, m = [int(item) for item in input().split()]\n\nans = 1\nfor i in range(1, int(math.sqrt(m))+1):\n if m%i == 0 \n if m >= i*n:\n ans = max(ans, i)\n else:\n ans = max(ans, m%i)\n \nprint(ans)', 'import math\nn, m = [int(item) for item in input().split()]\n\nans = 0\nfor i in range(1, int(math.sqrt(m))+1):\n if m%i == 0:\n if m >= i*n:\n ans = max(ans, i)\n if i>= n:\n ans = max(ans, m//i)\n \nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s384359941', 's560821392'] | [2940.0, 3060.0] | [17.0, 21.0] | [215, 220] |
p03241 | u054412614 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['def make_divisors(n):\n lower_divisors,upper_divisors=[],[]\n i=1\n while i*i<=n:\n if n%i=0:\n lower_divisors.append(i)\n if i!=n//i:\n upper_divisors.append(n//i)\n i+=1\n return lower_divisors+upper_divisors[::-1]\nn,m=map(int,input().split())\narray=make_divisors(m)\narray.reverse()\nfor ele in array:\n if m//ele>=n:\n print(ele)\n exit()\n ', 'def cd_generator(num):\n i=1\n lower=[]\n upper=[]\n while i*i<=num:\n if num%i==0:\n lower.append(i)\n if num!=i*i:\n upper.append(num//i)\n i+=1\n return reversed(lower+upper[::-1])\nn,m=map(int,input().split())\n\nfor ele in cd_generator(m):\n if m/ele>=n:\n print(ele)\n exit()\n'] | ['Runtime Error', 'Accepted'] | ['s401329176', 's301342233'] | [9016.0, 9152.0] | [26.0, 34.0] | [417, 349] |
p03241 | u062459048 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n, m = map(int,input().split())\n\nan = m //n\nwhile an*n != m:\n an = m//n\n n = 1 + (m-1)*an\n \nprint(an)\n', 'n, m = map(int,input().split())\n\nan = m //n\nwhile an*n != m:\n an = m//n\n n = 1 + (m-1)//an\n \nprint(an)\n'] | ['Time Limit Exceeded', 'Accepted'] | ['s649785929', 's185657688'] | [2940.0, 2940.0] | [2104.0, 36.0] | [105, 106] |
p03241 | u065079240 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\nN, M = map(int, input().split())\nans = 1\nfor i in range(2, math.ceil(math.sqrt(M))//3):\n if M % i == 0:\n if M // i >= 1:\n ans = i\n else:\n break\nprint(ans)\n', 'import math\nN, M = map(int, input().split())\nans = 1\nfor i in range(2, math.floor(math.sqrt(M))//3):\n if M % i == 0:\n if M // i >= 1:\n ans = i\n else:\n break\nprint(ans)\n', 'import math\nN, M = map(int, input().split())\nans = 1\n\nfor i in range(1, int(math.sqrt(M))+1):\n if M % i == 0.0:\n if M // i >= N and ans < i:\n ans = i\n if M // (M // i) >= N and ans < (M // i):\n ans = M // i\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s975060772', 's976485377', 's061958997'] | [2940.0, 2940.0, 3060.0] | [19.0, 19.0, 22.0] | [206, 207, 257] |
p03241 | u069838609 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ["from math import floor, ceil\nN, M = [int(elem) for elem in input().split(' ')]\n\nmax_gcd = 1\ncand = M // N\n\nfor cand in range(M // N, 1, -1):\n rest = M - cand * N\n if rest % cand == 0:\n max_gcd = max(max_gcd, cand)\n break\n else:\n continue", "from math import floor, ceil, sqrt\nN, M = [int(elem) for elem in input().split(' ')]\n\ndef factorize(n):\n fct = [] \n b, e = 2, 0 \n while b * b <= n:\n while n % b == 0:\n n = n // b\n e = e + 1\n if e > 0:\n fct.append((b, e))\n b, e = b + 1, 0\n if n > 1:\n fct.append((n, 1))\n return fct\n\n\ndef divisorize(fct):\n try:\n b, e = fct.pop() \n except:\n return []\n pre_div = divisorize(fct) if fct else [[]]\n suf_div = [[(b, k)] for k in range(e + 1)]\n return [pre + suf for pre in pre_div for suf in suf_div]\n\n\ndef num(fct):\n a = 1\n for base, exponent in fct:\n a = a * base**exponent\n return a\n\nM_divisors = divisorize(factorize(M))\nthreshold = M // N\nmax_possible_divisor = 1\nfor M_divisor in M_divisors:\n divisor = num(M_divisor)\n if divisor <= threshold:\n max_possible_divisor = max(max_possible_divisor, divisor)\nprint(max_possible_divisor)\n"] | ['Wrong Answer', 'Accepted'] | ['s979463610', 's424284586'] | [3060.0, 3064.0] | [2103.0, 23.0] | [267, 1014] |
p03241 | u075012704 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N, M = map(int, input().split())\n\nif N == 1:\n print(M)\nelse:\n ans = 1\n for g in range(1, int(M ** 0.5) + 2):\n if M % g == 0 and M / g >= N:\n ans = max(ans, g)\n\n g2 = M / g\n if M % g2 == 0 and M / g2 >= N:\n ans = max(ans, int(g2))\n print(ans)\n', 'N, M = map(int, input().split())\n\nans = 0\nfor x in range(1, int(M ** 0.5) + 1):\n if M % x != 0:\n continue\n else:\n x1, x2 = x, M // x\n if M // x1 >= N:\n ans = max(ans, x1)\n if M // x2 >= N:\n ans = max(ans, x2)\n\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s437202665', 's039623921'] | [3316.0, 3060.0] | [32.0, 21.0] | [297, 277] |
p03241 | u077337864 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N, M = map(int, input().strip().split())\n\ni=1\nwhile i*i < M:\n if M % i == 0:\n maxg = M // N\n i += 1\n\nprint(maxg)', 'N, M = map(int, input().strip().split())\n\ni=1\nwhile i <= M//N: \n if M % i == 0:\n maxg = i\n if M//i <= M//N:\n maxg = M // i\n break\n i += 1\n\nprint(maxg)\n'] | ['Runtime Error', 'Accepted'] | ['s687326650', 's541408287'] | [2940.0, 2940.0] | [26.0, 62.0] | [117, 169] |
p03241 | u085717502 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ["\n# coding: utf-8\n\n# In[12]:\n\n\nimport numpy as np\n\n\n# In[65]:\n\n\nN,M = map(int, input().split())\n\n\n# In[66]:\n\n\ndef usage(n):\n print('\n fct = factorize(n)\n print(fct, num(fct))\n \n print('\n for div in divisorize(fct):\n print(div, num(div))\n\n\ndef factorize(n):\n fct = [] \n b, e = 2, 0 \n while b * b <= n:\n while n % b == 0:\n n = n // b\n e = e + 1\n if e > 0:\n fct.append((b, e))\n b, e = b + 1, 0\n if n > 1:\n fct.append((n, 1))\n return fct\n\n\ndef divisorize(fct):\n b, e = fct.pop() \n pre_div = divisorize(fct) if fct else [[]]\n suf_div = [[(b, k)] for k in range(e + 1)]\n return [pre + suf for pre in pre_div for suf in suf_div]\n\n\ndef num(fct):\n a = 1\n for base, exponent in fct:\n a = a * base**exponent\n return a\n\n\n# In[67]:\n\n\ndef func(n):\n fct = factorize(n)\n ret = []\n for div in divisorize(fct):\n ret.append(num(div))\n \n return ret\n\n\n# In[68]:\n\n\ndiv = np.array(func(M))\n\n\n# In[69]:\n\n\nprint(div[div < M/N].max())\n\n", '#!/usr/bin/env python\n# coding: utf-8\n\n# In[11]:\n\n\nN,M = map(int, input().split())\n\n\n# In[12]:\n\n\ndef make_divisors(n):\n lower_divisors , upper_divisors = [], []\n i = 1\n while i*i <= n:\n if n % i == 0:\n lower_divisors.append(i)\n if i != n // i:\n upper_divisors.append(n//i)\n i += 1\n return lower_divisors + upper_divisors[::-1]\n\n\n# In[14]:\n\n\nfor x in make_divisors(M)[::-1]:\n if M//x >= N:\n ans = x\n break\nprint(ans)\n\n\n# In[ ]:\n\n\n\n\n'] | ['Runtime Error', 'Accepted'] | ['s365117476', 's010034180'] | [21220.0, 9128.0] | [319.0, 38.0] | [1132, 511] |
p03241 | u089142196 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\nN,M=map(int,input().split())\n\nP=math.ceil(M**0.5)\nans=1\ni=1\n\nwhile i<=P:\n if M%i==0:\n j = M//i\n if j>=N:\n ans=j\n i +=1\n \nprint(ans)', 'from math import floor\nN,M=map(int,input().split())\np= floor(M**0.5)\nkumi=[]\n\nfor i in range(1,p+1):\n if M%i==0:\n kumi.append((i,M//i))\n \nans=1\nfor pair in kumi:\n if pair[0]>=N:\n ans = max(ans,pair[1])\n if pair[1]>=N:\n ans = max(ans,pair[0])\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s758106425', 's845157946'] | [3064.0, 3064.0] | [24.0, 21.0] | [161, 267] |
p03241 | u095426154 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['n,m=map(int,input().split())\nif m%i==0:\n ans=m//i\nelse:\n ans=m//i-1\nprint(ans)', 'def make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n\n divisors.sort()\n return divisors\n\nn,m=map(int,input().split())\nl=make_divisors(m)\nfor i in l:\n if n<=i:\n ans=m//i\n break\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s336573180', 's539098377'] | [2940.0, 3060.0] | [18.0, 20.0] | [84, 354] |
p03241 | u102126195 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N, M = map(int, input().split())\nans = 1\n\nS = M / N\nS = int(S)\n#print(S)\nimport math\nif N == 1:\n ans = M\nelse:\n not_sosu = -1\n for i in range(2, int(math.sqrt(M)) + 1):\n if M % i == 0:\n not_sosu = 1\n if M / i >= N and M % i == 0:\n ans = max(ans, i)\n j = M // i\n if M / j >= N and M % j == 0:\n ans = max(ans, j)\n #print(i)\n if not_sosu == -1:\n ans = 1\n', 'N, M = map(int, input().split())\nans = 1\n\nS = M / N\nS = int(S)\n#print(S)\nimport math\nif N == 1:\n ans = M\nelse:\n not_sosu = -1\n for i in range(2, int(math.sqrt(M)) + 1):\n if M % i == 0:\n not_sosu = 1\n if M / i >= N and M % i == 0:\n print(100)\n ans = max(ans, i)\n j = M // i\n if M / j >= N and M % j == 0:\n print(2999)\n ans = max(ans, j)\n #print(i)\n if not_sosu == -1:\n ans = 1\n\n\nif N == 1:\n ans = M\n\nprint(ans)\n', 'N, M = map(int, input().split())\n\ni = 1\nans = 0\nwhile True:\n if i * i > M + 1:\n break\n j = M // i\n if M % i == 0 and M // i >= N:\n ans = max(ans, i)\n if M % j == 0 and M // j >= N:\n ans = max(ans, j)\n i += 1\n \n\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s529288318', 's618944907', 's887326942'] | [3064.0, 3064.0, 2940.0] | [21.0, 21.0, 33.0] | [462, 554, 261] |
p03241 | u102461423 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N,M = map(int, input().split())\n\n\n\ndivisors = []\nfor d in range(1, M+1):\n if d*d > M:\n break\n divisors.append(d)\n divisors.append(M//d)\n\nans = 1\n\nfor d in divisors:\n if N*d <= M:\n ans = d\n\nprint(ans)', 'N,M = map(int, input())\n\n\n\ndivisors = []\nfor d in range(1, M+1):\n if d*d > M:\n break\n divisors.append(d)\n divisors.append(M//d)\n\nans = 1\n\nfor d in divisors:\n if N*d <= M:\n ans = d\n\nprint(ans)', 'N,M = map(int, input().split())\n\n\n\ndivisors = []\nfor d in range(1, M+1):\n if d*d > M:\n break\n if M%d == 0:\n divisors.append(d)\n divisors.append(M//d)\n\nans = 1\n\ndivisors.sort()\n\nfor d in divisors:\n if N*d <= M:\n ans = d\n\nprint(ans)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s787043078', 's797094708', 's325754440'] | [5628.0, 3060.0, 3060.0] | [38.0, 17.0, 25.0] | [281, 273, 323] |
p03241 | u108617242 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\nN, M = map(int, input().split())\ntmp = [1]\nif N == 1:\n print(M)\nelse:\n for i in range(2, int(math.ceil(M**0.5))):\n if M % i == 0:\n tmp.append(i)\n tmp.apend(M/i)\n ans = 1\n for x in tmp:\n if m / x >= N:\n ans = max(ans, x)\n print(ans)\n', 'import math\nN, M = map(int, input().split())\ntmp = [1]\nif N == 1:\n print(M)\nelse:\n for i in range(2, int(math.ceil(M**0.5))):\n if M % i == 0:\n tmp.append(i)\n tmp.append(M/i)\n ans = 1\n for x in tmp:\n if m / x >= N:\n ans = max(ans, x)\n print(ans)\n', 'import math\nN, M = map(int, input().split())\ntmp = [1]\nif N == 1:\n print(M)\nelse:\n for i in range(2, math.ceil(M**0.5)):\n if M % i == 0:\n tmp.append(i)\n tmp.apend(M/i)\n ans = 1\n for x in tmp:\n if m / x >= N:\n ans = max(ans, x)\n print(ans)\n', 'import math\nN, M = map(int, input().split())\ntmp = [1]\nif N == 1:\n print(M)\nelse:\n for i in range(2, int(math.ceil(M**0.5))):\n if M % i == 0:\n tmp.append(i)\n tmp.append(int(M/i))\n ans = 1\n for x in tmp:\n if M / x >= N:\n ans = max(ans, x)\n print(ans)\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s306118548', 's703469569', 's751353024', 's264548628'] | [3188.0, 3188.0, 3188.0, 3188.0] | [21.0, 21.0, 21.0, 21.0] | [306, 307, 301, 312] |
p03241 | u114920558 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\nN, M = map(int, input().split())\n\nans = 1\nif(N < M//N):\n i = N\n while(ans == 1 and i <= math.sqrt(M)):\n if(M % i == 0):\n ans = M//i\n i += 1\nelse:\n i = M//N\n while(ans == 1 and i >= 1):\n if(M % i == 0):\n ans = i\n i -= 1\n \nprint(ans)', 'import math\nN, M = map(int, input().split())\n\nans = 1\nif(N < M//N):\n i = N\n while(ans == 1 and i <= math.sqrt(M)):\n if(M % i == 0):\n ans = M//i\n i += 1\nif(N >= M//N or ans == 1):\n i = M//N\n while(ans == 1 and i >= 1):\n if(M % i == 0):\n ans = i\n i -= 1\n \nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s708477030', 's202104070'] | [3060.0, 3064.0] | [26.0, 64.0] | [270, 291] |
p03241 | u118642796 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N,M = map(int,input().split())\nl = m//n\nif M+1-N < l:\n for i in range(N,M+1):\n if M%i == 0:\n print(M//i)\n break\nelse:\n for i in range(l,-1,-1):\n if m % i == 0:\n print(i)\n break', 'N,M = map(int,input().split())\nans_candidate = range(N,M+1)\nfor i in range(N,M+1//2):\n if M%i == 0:\n print(M//i)\n break\nprint(1)\n', 'N,M = map(int,input().split())\nfor i in range(N,M+1):\n if M%i == 0:\n print(M/i)\n break\n', 'N,M = map(int,input().split())\ndef f(N,M+1):\n if M%i ==0:\n return(M//i)\nprint(f(N,M+1))', 'N,M = map(int,input().split())\nd = [i for i in range(1,int(M**0.5)+1) if M%i==0]\nd.extend([M//i for i in d])\nprint(max([i for i in d if M//i>=N]))'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s004863826', 's170823800', 's295526508', 's852701187', 's748738856'] | [2940.0, 2940.0, 2940.0, 2940.0, 3060.0] | [17.0, 2103.0, 2104.0, 17.0, 33.0] | [240, 146, 104, 97, 146] |
p03241 | u127499732 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ["def main():\n from math import gcd\n n, m = map(int, input().split())\n\n if gcd(n, m) == 1:\n print(1)\n exit()\n\n l = int(m / n)\n for i in range(l, 1, -1):\n p, q = divmod(m, i)\n if q != 0 or p < n:\n continue\n\n print(i)\n break\n\n\nif __name__ == '__main__':\n main()\n", "def main():\n from fractions import gcd\n n, m = map(int, input().split())\n ans = 1\n l = int(m / n)\n for i in range(2, l + 1):\n p, q = divmod(m, i)\n if q != 0 or p < n:\n continue\n\n ans = max(ans, i)\n\n print(ans)\n\n\nif __name__ == '__main__':\n main()\n", "def main():\n from fractions import gcd\n n, m = map(int, input().split())\n\n if gcd(n, m) == 1:\n print(1)\n exit()\n\n l = int(m / n)\n for i in range(l, 1, -1):\n p, q = divmod(m, i)\n if q != 0 or p < n:\n continue\n\n print(i)\n break\n\n\nif __name__ == '__main__':\n main()\n", "def main():\n n, m = map(int, input().split())\n for i in range(int(m / n), 0, -1):\n if m % i == 0:\n print(i)\n break\n\n\nif __name__ == '__main__':\n main()\n"] | ['Runtime Error', 'Time Limit Exceeded', 'Wrong Answer', 'Accepted'] | ['s069629508', 's228596460', 's290079693', 's515854093'] | [3060.0, 5176.0, 5048.0, 2940.0] | [17.0, 2104.0, 2104.0, 1791.0] | [329, 300, 334, 190] |
p03241 | u129836004 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['N, M = map(int, input().split())\nx = 0\nm = 0\nfor i in range(10**5):\n if i**2 < M <= i*(i+1):\n m = i+1\n break\nfor i in range(N, m):\n if M % i == 0:\n x = M // i\n break\nif x == 0:\n for i in reversed(range(1,m+1)):\n if M % i == 0:\n x = i\n break\nprint(x)', 'N, M = map(int, input().split())\nx = 0\nm = 0\nfor i in range(10**5):\n if i**2 < M <= (i+1)**2:\n m = i+1\n break\nif m >N:\n for i in range(N, m):\n if M % i == 0:\n x = M // i\n break\nif x == 0:\n for i in reversed(range(1, M //N +1)):\n if M % i == 0:\n x = i\n break\nprint(x)'] | ['Wrong Answer', 'Accepted'] | ['s401768658', 's780059999'] | [3060.0, 3060.0] | [54.0, 57.0] | [315, 347] |
p03241 | u136090046 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import fractions\nimport math\n\nn,m = map(int, input().split())\n\nres = 0\ntmp = math.ceil(m/n)\nfor i in range(1, tmp+1):\n res = (max(res, fractions.gcd(i, m-((n-1)*i))))\nprint(res)\n', 'import fractions\n\nn,m = map(int, input().split())\n\nres = 0\ntmp = math.ceil(m/n)\nfor i in range(1, tmp+1):\n res = (max(res, fractions.gcd(i, m-((n-1)*i))))\nprint(res)\n', 'import math\n\nn, m = map(int, input().split())\narray = []\nfor i in range(1, int(math.sqrt(m)+1)):\n if m % i == 0:\n array.append([i, m//i])\n\ndiff = float("inf")\nres = 0\nfor i, j in array:\n if i >= n:\n res = max(res, j)\n if j >= n:\n res = max(res, i)\nprint(res)\n'] | ['Time Limit Exceeded', 'Runtime Error', 'Accepted'] | ['s214477870', 's923824403', 's911510675'] | [5432.0, 5436.0, 3060.0] | [2108.0, 44.0, 22.0] | [181, 169, 289] |
p03241 | u139112865 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['#112_D\nN,M=map(int,input().split())\n\ndivisors=[]\nfor i in range(1,int(M**.5)+1):\n if M%i==0:\n divitors.append(i)\n if i!=(M//i):\n divitors.append(M//i)\nAns=1\nfor x in divitors:\n if M//N>=x:\n Ans=x\n else:\n break\nprint(Ans)', '#112_D\nN,M=map(int,input().split())\n\ndivisors=[]\nfor i in range(1,int(M**.5)+1):\n if M%i==0:\n divisors.append(i)\n if i!=(M//i):\n divisors.append(M//i)\nAns=1\nfor x in sorted(divisors):\n if M//N>=x:\n Ans=x\n else:\n break\nprint(Ans)'] | ['Runtime Error', 'Accepted'] | ['s271325258', 's272146519'] | [3060.0, 3188.0] | [21.0, 22.0] | [301, 309] |
p03241 | u160244242 | 2,000 | 1,048,576 | You are given integers N and M. Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N. | ['import math\n\nn,m = map(int, input().split())\n\nfor i in range(1, math.ceil(math.sqrt(m+1))):\n if m % i != 0:\n continue\n if m // i > n:\n continue\n ans = i\nprint(ans)', 'inputlist = list(map(int, input().split()))\nn, m = inputlist[0], inputlist[1]\n\nfor i in range(1, int(math.sqrt(m+1))):\n if m % i != 0:\n continue\n if i > m // n:\n continue\n ans = i\nprint(ans)\n ', 'import math\n\nn,m = map(int, input().split())\n\n\nans = 0\nfor i in range(1, math.ceil(math.sqrt(m))+1):\n if m % i == 0:\n if min(i, m//i) >= n:\n ans = max(ans, max(i, m//i))\n elif max(i, m//i) >= n:\n ans = max(ans, min(i, m//i))\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s535290969', 's721835386', 's265747725'] | [2940.0, 2940.0, 3064.0] | [22.0, 18.0, 22.0] | [186, 218, 274] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.