Problem:


Score : 200 points

Problem Statement

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.

Constraints

All values in input are integers.

1 \leq N \leq 100

1 \leq T \leq 1000

1 \leq c_i \leq 1000

1 \leq t_i \leq 1000

The pairs (c_i, t_i) are distinct.

Input

Input is given from Standard Input in the following format:

N T
c_1 t_1
c_2 t_2
:
c_N t_N

Output

Print the smallest cost of a route that takes not longer than time T.

If there is no route that takes not longer than time T, print TLE instead.

Sample Input 1

3 70
7 60
1 80
4 50

Sample Output 1

4

The first route gets him home at cost 7.

The second route takes longer than time T = 70.

The third route gets him home at cost 4.

Thus, the cost 4 of the third route is the minimum.

Sample Input 2

4 3
1 1000
2 4
3 1000
4 500

Sample Output 2

TLE

There is no route that takes not longer than time T = 3.

Sample Input 3

5 9
25 8
5 9
4 10
1000 1000
6 1

Sample Output 3

5



Sample input:
3 70
7 60
1 80
4 50


Sample output:
4

Submission status: Wrong Answer

Solution code:
n, t = list(map(int, input().split()))
data = []
for i in range(n):
    data.append(list(map(int, input().split())))
minCost = 1001
for i in range(n):
    if data[i][1] <= t:
        minCost = data[i][0]

if minCost == 1001:
    print("TLE")
else:
    print(minCost)

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
min_cost = 10**3 + 1
for i in range(N):
    c, t = map(int,input().split())
    if t <= T and c < min_cost:
        min_cost = c
if c != 10**3 + 1:
    print(min_cost)
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
n,t = map(int,input().split())
l=[]
cc=999
for i in range(n):
   c,tt = map(int,input().split())
   if tt<=t:
       if c<cc:
           cc=c
if cc==999:
    print("TLE")
else:
    print(cc)

Submission status: Wrong Answer

Solution code:

n,t=map(int,input().split())

res=None

for _ in range(n):
    c,u=map(int,input().split())
    if u <= t:
        res = min(res,u) if res else u

print(res if res else "TLE")

Submission status: Wrong Answer

Solution code:
n,T = map(int, input().split())
ans = float('inf')
flag = True
for i in range(n):
    c,t = map(int, input().split())
    if t <= T and c <= ans:
        ans = c
        flag = False
if flag:
    print("TLE")
else:
    print("ans")

Submission status: Wrong Answer

Solution code:
import sys

n,t = map(int, input().split())
ls = [[int(i) for i in input().split()] for _ in range(n)]
ans = float('inf')

for i in range(n):
    if ls[i][1] <= t:
        ans = min(ls[i][0],ans)
    elif i == n - 1:
        print("TLE")
        sys.exit()
print(ans)

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())

ans = 1000
for i in range(n):
    a, b = map(int, input().split())
    if b <= t:
        ans = min(ans, a)

print(ans)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(N)]
ct.sort(key=lambda x:(x[1], x[0]))
if ct[0][1] <= T:
  print(ct[0][0])
else:
  print('TLE')

Submission status: Wrong Answer

Solution code:
N,T=map(int, input().split())
R=[999999999]
for i in range(N):
  c,t=map(int, input().split())
  if T>t:
    R.append(c)
    
print('TLE' if len(R)==1 else min(R))

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
ans=1001
for _ in range(N):
    c, t = map(int, input().split())
    if T>t:
        ans=min(ans,c)

if ans==1001:
    print('TLE')
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
ans=1001
for _ in range(N):
    c, t = map(int, input().split())
    if T>t:
        ans=min(ans,c)

if ans==1001:
    print('TLE')

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
N, T = map(int, input().split())
ans=[]
limit=0
count=1

for _ in range(N):
    c, t = map(int, input().split())
    if T>t:
        ans.append([count,c])
        count+=1
    else:
        limit+=1
        if limit==N:
            print('TLE')
            sys.exit()
    
    ans=sorted(ans,key=lambda x:x[1])

print(ans[0][1])

Submission status: Wrong Answer

Solution code:
import sys
N, T = map(int, input().split())
ans=[]
limit=0
count=0

for _ in range(N):
    c, t = map(int, input().split())
    if T>t:
        ans.append([count,c])
        count+=1
    else:
        limit+=1
        if limit==N:
            print('TLE')
            sys.exit()
    
    ans=sorted(ans,key=lambda x:x[1])

print(ans[0][1])

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
ans = float("inf")

for i in range(n):
    nx, tx = map(int, input().split())
    if tx < t:
        ans = min(ans, nx)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split()))
b = list(list(map(int,input().split())) for i in range(a[0]))
c = 1000

for i in range(a[0]):
  if b[i][1]<=a[1]:
    c = min(c,b[i][0])
else:
  if c==1000:
    print("TLE")
  else:
    print(c)

Submission status: Wrong Answer

Solution code:
n,t = map(int, input().split())
keiro = []
for _ in range(n):
    keiro.append(list(map(int, input().split())))

ans = 0
for i in range(n):
    v = keiro[i][1]
    dif = v
    if keiro[i][1] > t:
        continue
    else:
        v = min(v, keiro[i][0] / keiro[i][1])
        if v != dif:
            ans = keiro[i][0]

if ans == 0:
    print("TLE")
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
n,t = map(int, input().split())
keiro = []
for _ in range(n):
    keiro.append(list(map(int, input().split())))

ans = 0
v = keiro[0][0] / keiro[0][1]
for i in range(1, n):
    dif = v
    if keiro[i][1] > t:
        continue
    else:
        v = min(v, keiro[i][0] / keiro[i][1])
        if v != dif:
            ans = keiro[i][0]

if ans == 0:
    print("TLE")
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())

measure = 65536
ans = 0

for i in range(n):
  cost, time = map(int, input().split())
  if time < measure:
    measure = time
    ans = cost

if not measure < t:
  ans = 'TLE'
print(ans)

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
paths = []
for i in range(N):
  cost, time = map(int,input().split())
  if time < T:
    paths.append(cost)
if len(paths) == 0:
  print("TLE")
else:
  print(min(paths))

Submission status: Wrong Answer

Solution code:
#外出している X さんは、ABC に参加するためにスマートウォッチで最適な帰宅経路を調べることにしました。
#スマートウォッチであるあなたは、N 個の帰宅経路を見つけました。
#X さんが i 番目の経路を使う場合、コスト ci かけて時間 ti で帰宅できます。
#時間 T 以内に帰宅できる経路のうち、コストが最小となる経路のコストを求めてください。

N, T = map(int, input().split())
C = []

for i in range(N):
    c, t = map(int, input().split())
    if t<T:
        C.append(c)
ans=sorted(C)
if len(ans)>=1:
    print(ans[0])
else:
    print('TLE')

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
cost=1000
for _ in range(N):
    c,t=map(int,input().split())
    if t<=T:
        if cost>=c:
            cost=c
if cost<=1000:
    print(cost)
else:print("TLE")

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
cost=1000
for _ in range(N):
    c,t=map(int,input().split())
    if t<=T:
        if cost>c:
            cost=c
if cost<1000:
    print(cost)
else:print("TLE")

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
cost=1000
for _ in range(N):
    c,t=map(int,input().split())
    if t<=T:
        if cost>c:
            cost=c
if cost>1000:
    print(cost)
else:print("TLE")

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
cost=1000
for _ in range(N):
    c,t=map(int,input().split())
    if t<=T:
        if cost>=c:
            cost=c
if cost>1000:
    print(cost)
else:print("TLE")

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
cost=1000
for _ in range(N):
    c,t=map(int,input().split())
    if t<=T:
        if cost>=c:
            cost=c
if cost>=1000:
    print(cost)
else:print("TLE")

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
cost=1000
for _ in range(N):
    c,t=map(int,input().split())
    if t<T:
        if cost>c:
            cost=c
if cost!=1000:
    print(cost)
else:print("TLE")

Submission status: Wrong Answer

Solution code:
N,T = map(int, input().split())
ans = 1005
for i in range(N):
    c,t = map(int, input().split())
    if t <= T:
        ans = min(ans, c)
print(ans)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())

min_c = 1000
for _ in range(N):
    c, t = map(int, input().split())

    if t <= T and c < min_c:
        min_c = c

if min_c == 1000:
    print("TLE")
else:
    print(min_c)

Submission status: Wrong Answer

Solution code:
n,t = map(int,input().split())
lst = [[int(i) for i in input().split()] for i in range(n)]

cst = 'TLE'
for i in range(n):
    if lst[i][1] < t:
        if cst == 'TLE':
            cst = lst[i][0]
        elif lst[i][0] < cst:
            cst = lst[i][0]
print(cst)

Submission status: Wrong Answer

Solution code:
n,t=map(int,input().split())
d = [list(map(int, input().split())) for i in range(n)]

ans = [d[i][0] for i in range(len(d)-1) if d[i][1] <= t]
if len(ans) == 0:
    print("TLE")
else:
    print(min(ans))

Submission status: Wrong Answer

Solution code:
n,t=map(int,input().split())
d = [list(map(int, input().split())) for i in range(n)]

d = sorted(d, key = lambda x: x[0])
d = sorted(d, key = lambda x: x[1])

i = 0
ans = [d[i][0] for i in range(len(d)-1) if d[i][1] <= t]
if len(ans) == 0:
    print("TLE")
else:
    print(min(ans))

Submission status: Wrong Answer

Solution code:
N, T = [int(x) for x in input().split()]
min_c = 1000
for i in range(N):
  c, t = [int(x) for x in input().split()]
  if T >= t:
    min_c = min(min_c, c)
print(min_c if min_c < 1000 else 'TLE')

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, d=DVSR): return pow(x, d - 2, d)
def DIV(x, y, d=DVSR): return (x * INV(y, d)) % d
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())

N,T=LI()
INL = [LI() for i in range(N)]

res = INTMAX
for c,t in INL:
    if t <= T:
        res = min(res, c)

if res > T:
    print('TLE')
else:
    print(res)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
min_cost = 2000
for i in range(N):
    c, t = map(int, input().split())
    if t < T:
        min_cost = min(min_cost, c)
        
if min_cost == 2000:
    print("TLE")
else:
    print(min_cost)

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
L = []
cost = 1145141919810
for i in range(N):
  L.append(input().split())
for i in range(0,N):
  S = L[i][1]
  M = L[i][0]
  if int(S)<=T:
    if int(M)<=int(cost):
      cost = M
print(cost)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
ans = 1000
flag = True
for i in range(N):
    c,t = map(int, input().split())
    if T >= t and c < ans:
        ans = c
        flag = False
if flag:
    print("TLE")
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
N,T = map(int, input().split())

ans = 10000

for i in range(N):
  c,t = map(int, input().split())
  
  if t<=T and c<ans:
    ans=c
    
print(ans)

Submission status: Wrong Answer

Solution code:
n,t=map(int,input().split())

for i in range(n):
    ans=float("inf")
    a,b=map(int,input().split())
    if b<(t+1):
        ans=min(a,ans)

if ans==float("inf"):
    print("TLE")
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
N,T = map(int, input().split())

min_t = T + 1
ans = 10000

for i in range(N):
  c,t = map(int, input().split())
  
  if t<min_t:
    min_t = t
    ans = c
  elif t==min_t:
    if ans>c:
      ans=c

if ans!=10000:
  print(ans)
else:
  print("TLE")

Submission status: Wrong Answer

Solution code:
N,T = map(int, input().split())

min_t = T + 1
ans = "TLE"

for i in range(N):
  c,t = map(int, input().split())
  if t<min_t:
    min_t = t
    ans = c
    
print(ans)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())

i = []
for _ in range(N):
    c, t = map(int, input().split())
    i.append([c,t])

cmin = 1000
for n in range(N):    
    if i[n][1] <= T and i[n][0] < cmin:
        cmin = i[n][0]

if cmin == 1000:
    print('TLE')
else:
    print(cmin)

Submission status: Wrong Answer

Solution code:
n,t = map(int,input().split())
lis = [list(map(int,input().split())) for x in range(n)]

lis = sorted(lis)
def TimeLimit(lis):
    for x in lis:
        if t > x[1]:
            print(x[0])
            return
    else:
        print('TLE')
TimeLimit(lis)

Submission status: Wrong Answer

Solution code:
n,t = map(int,input().split())
out = 1001
o = t+1
outnum = 1001
for i in range(n):
  c, tim = map(int,input().split())
  if tim < t and c < out:
    out = c
    outnum = i
if outnum == 1001:
  print('TLE')
else:
  print(out)

Submission status: Wrong Answer

Solution code:
n,t = map(int,input().split())
out = 1001
o = t+1
outnum = 1001
for i in range(n):
  c, tim = map(int,input().split())
  if tim < t and c < out:
    out = c
    outnum = i
if outnum == 1001:
  print('TLE')
else:
  print(outnum)

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
ct = [input() for i in range(n)]
m = t+1
for i in ct:
    cost, time = i.split()
    cost = int(cost)
    time = int(time)
    if time <= t:
        if cost < m:
            m = cost
if m > t:
    print('TLE')
else:
    print(m)

Submission status: Wrong Answer

Solution code:
n, t_l = map(int, input().split())
for i in range(n):
    c, t = map(int, input().split())
cost = []
for i in range(n):
    if t <= t_l:
        cost.append(c)
if cost == []:
    print("TLE")
else:
    print(min(cost))

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
ct = []
for _ in range(N):
    ct.append(list(map(int,input().split())))

ans = 1001
for i in ct:
    if T > i[1]:
        ans = min(ans, i[0])

if ans == 1001:
    print('TLE')
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
ans=10**10
for i in range(N):
    c,t=map(int,input().split())
    if c<ans and t<=T: ans=c
print(ans)

Submission status: Wrong Answer

Solution code:
n,T = map(int,input().split())
c = [0]*n
t = [0]*n

for i in range(n):
    c[i],t[i] = map(int,input().split())

cost= 10000
for i in range(n):
    if t[i] <= T and c[i] <= cost:
        cost = c[i]
        print(i)
if cost == 10000:
    print("TLE")
else:
    print(cost)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
ct = [[] for _ in range(N)]
for i in range(N):
    ct[i] = list(map(int, input().split()))
cost =[]
for v in ct:
    if v[1] <= T:
        cost.append(v)
if len(cost) <1:
    print('TLE')
else:
    for i, v in enumerate(cost):
        if i == 0:
            least = v[0]
        else:
            if v[0] <= least:
                least = v[0]
    if least <= T:
        print(least)
    else:
        print('TLE')

Submission status: Wrong Answer

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n , T =f()

    minc = 10000
    for i in range(n):
        c,t = f()
        if t<= T:
            mic = min(minc, c)
    
    if minc == 10000:
        print('TLE')
    else:
        print(minc)

solve()

Submission status: Wrong Answer

Solution code:

lst_1 = input().split()

N = int(lst_1[0])
T = int(lst_1[1])

ans = "TLE"
cost_min = 9999

lst_A = []

for i in range(N):

    lst_A.append(input().split())

for i in range(N):

    if (int(lst_A[i][0]) < cost_min) and (int(lst_A[i][1]) <= T):
        ans = int(lst_A[i][0])

print(ans)

Submission status: Wrong Answer

Solution code:

lst_1 = input().split()

N = int(lst_1[0])
T = int(lst_1[1])

ans = "TLE"
cost_min = 9999

lst_A = []

for i in range(N):

    lst_A.append(input().split())

for i in range(N):

    if (int(lst_A[i][0]) < cost_min) and (int(lst_A[i][0]) <= T):
        ans = int(lst_A[i][0])

print(ans)

Submission status: Wrong Answer

Solution code:

lst_1 = input().split()

N = int(lst_1[0])
T = int(lst_1[1])

ans = "TLE"
cost_min = 9999

lst_A = []

for i in range(N):

    lst_A.append(input().split())

for i in range(N):

    if (int(lst_A[i][0]) < cost_min) and (int(lst_A[i][0]) <= T):
        ans = lst_A[i][0]

print(ans)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
l = []
ans = 1000
for _ in range(N):
    c, t = map(int, input().split())
    if t <= T and c < ans:
        l.append(t)
        ans = c

if l:
    print(ans)
else:
    print('TLE')

Submission status: Wrong Answer

Solution code:
from __future__ import print_function
# import numpy as np
# import numpypy as np
import sys
import math
import string
import fractions
import re
import array
import copy
import functools
import operator

import collections
import itertools
import bisect
import heapq


from heapq import heappush
from heapq import heappop

# from itertools import accumulate
# from collections import deque
import random




def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)


def main():
    n,t = map(int, input().split())
    minx=sys.maxsize
    for i in range(n):
        cc,tt = map(int, input().split())
        if tt<=t:
            minx = cc if cc<minx else minx
    print(minx)
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
c_min = 1001

for i in range(N):
  c, t = map(int, input().split())
  if t < T and c < c_min:
    c_min = c

if c_min == 1001:
  print('TLE')
else:
  print(c_min)

Submission status: Wrong Answer

Solution code:
n,t = map(int, input().split())
minc = 10**8
for i in range(n):
    c, ti = map(int, input().split())
    if ti >= t: continue
    if c < minc: minc = c
print(minc if minc <= 10**3 else "TLE")

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
cList = []; tList = []
for i in range(N):
    c, t = map(int, input().split())
    cList.append(c); tList.append(t)
ans = 10**4
for i in range(N):
    if tList[i] <= T:
        ans = min(ans, cList[i])
print(ans)

Submission status: Wrong Answer

Solution code:
n,T=map(int,input().split())
C=1000
for i in range(n):
    c,t=map(int,input().split())
    if t<=T:
        C=min(C,c)
print(C)

Submission status: Wrong Answer

Solution code:
n,t = map(int,input().split())
ansseq=[]
for i in range(n):
  a,b = map(int,input().split())
  if b <= t:
    ansseq.append(b)
if len(ansseq) == 0:
  print("TLE")
else:
  print(min(ansseq))

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
max_t=T
list_c=[]
for i in range(N):
    c,t=list(map(int,input().split()))
    if t<=T:
        max_t=t
        list_c.append(c)
print("TLE" if max_t==T else min(list_c))

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())

min_cost = 1000
for _ in range(N):
    c, t = map(int, input().split())
    if T < t:
        continue

    min_cost = min(min_cost, c)

print(min_cost)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
A = [list(input().split()) for i in range(a)]
cost = 1000
for i in A:
    c = int(i[1])
    if b >= c:
        d = int(i[0])
        cost = min(cost, d)
print(cost)

Submission status: Wrong Answer

Solution code:
N, T = [int(i) for i in input().split()]
ct = []
for j in range(N):
  ct.append([int(i) for i in input().split()])
ct.sort()
flag = 0
for i in range(N):
  if ct[i][1] < T:
    print(ct[i][0])
    flag = 1
    break
if flag == 0:
  print("TLE")

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
w_dic = {}
for i in range(n):
  w, w_t = map(int, input().split())
  if w_t <= t:
    w_dic[i+1] = w
if w_dic:
  print(min(w_dic, key=w_dic.get))
else:
  print("TLE")

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
w_dic = {}
for i in range(n):
  w, w_t = map(int, input().split())
  if w_t < t:
    w_dic[i+1] = w
if w_dic:
  print(min(w_dic, key=w_dic.get))
else:
  print("TLE")

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
w_dic = {}
for i in range(n):
  w, w_t = map(int, input().split())
  if w_t < t:
    w_dic[i+1] = w
  else:
    w_dic["TLE"] = 0
print(min(w_dic, key=w_dic.get))

Submission status: Wrong Answer

Solution code:
# coding : UTF-8
from sys import stdin

N,T = map(int,stdin.readline().rstrip().split())
#ct_list = [ list(map(int,stdin.readline().rstrip().split())) for i in range(N) ]
c_list = []
for i in range(N):
    C = stdin.readline().rstrip().split()
    if int(C[1]) < T:
        c_list.append(int(C[0]))

def main():
    print( "TLE" if len(c_list) == 0 else min(c_list) )

if __name__ == '__main__' :
    main()

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
ans = 1001
for i in range(N):
    tmp = list(map(int, input().split()))
    if tmp[1] < T:
        ans = min(ans, tmp[0])

print(ans if ans != 1001 else "TLE")

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(N)]
ret = 10 ** 9
for c, t in ct:
	if t <= T:
		ret = min(ret, c)
if ret > 10 ** 9:
	print(ret)
else:
	print("TLE")

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(N)]
ret = 10 ** 9
for c, t in ct:
	if t <= T:
		ret = min(ret, c)
print(ret)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
e=1000
for i in range(a):
    c,d=map(int, input().split())
    if d<=b:
        e=min(e,c)
print(e if e!=1000 else "TLE")

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
c = [0] * N
t = [0] * N
for i in range(N):
    c[i],t[i] = map(int,input().split())
    
ans = 1001
for i in range(N):
    if t[i] < T:
        if c[i] < ans:
            ans = c[i]
            
if ans == 1001:
    print('TLE')
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
ans = 1001
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        ans = min(ans, c)
print(ans)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
ans = 1001
for i in range(N):
    c, t = map(int, input().split())
    if t < T:
        ans = min(ans, c)
print(ans)

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
m = 1001
for i in range(N) :
    c,t = map( int, input().split() )
    if t<=T:
        m = min(m,c)
    print('TLE' if m==1001 else m)

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
m = 1001
for i in range(N) :
    c,t = map( int, input().split() )
    if t<=T:
        m = min(m,c)
    print('TLF' if m==1001 else m)

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
m = 1001
for i in range(N) :
    c,t = map( int, input().split() )
    if t<=m:
        m = min(m,c)
    print('TLF' if m==1001 else m)

Submission status: Wrong Answer

Solution code:
N,T = map(int, input().split())
c = []
t = []

for i in range(N):
    a,b = map(int, input().split())
    c.append(a)
    t.append(b)

m = 100
for i in range(1,len(c)):
    if t[i]<= T:
        if m > c[i]:
            m = c[i]
if m == 100:
    print("TLE")
else:
    print(m)

Submission status: Wrong Answer

Solution code:
n,T=map(int,input().split())
cost=1001
for i in range(n):
    c,t=map(int,input().split())
    if T>t:cost=min(cost,c)
print(cost if cost<1001 else "TLE")

Submission status: Wrong Answer

Solution code:
import sys
n,t = list(map(int, input().split()))
imincost=1000
for _ in range(n):
    c_,t_ = list(map(int, input().split()))
    if t_ <= t and c_ <imincost:
        imincost = c_
print(imincost if imincost != 1000 else "TLE")

Submission status: Wrong Answer

Solution code:
N, T = [int(elem) for elem in input().split()]
min_cost = None
min_cost_time = None
for i in range(0, N):
  c, t = [int(elem) for elem in input().split()]
  if t < T:
    if min_cost is None:
      min_cost = c
      min_cost_time = t
    else:
      if c < min_cost:
        min_cost = c
        min_cost_time = t
if min_cost is None:
  print('TLE')
else:
  print(min_cost)

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
ans = 1001
for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        ans = min(ans,c)
print(ans)

Submission status: Wrong Answer

Solution code:
l = []
N, T = map(int, input().split())
for i in range(N):
    c, t = map(int, input().split())
    if T > t:
        l.append(c)
print(min(l)if len(l) >= 1 else 'TLE')

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
cost = []
time = []
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        cost.append(c)
        time.append(t)
if len(time) == 0:
    print("TLE")
else:
    min_time_index = time.index(min(time))
    print(cost[min_time_index])

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
c_t = []
for i in range(N):
    c_t.append(list(map(int, input().split())))
c_t.sort()
min_cost = 10000
for i in range(N):
    if c_t[i][1] <= T and c_t[i][0] < min_cost:
        min_cost = c_t[i][0]
if min_cost >= 1000:
    print('TLE')
else:
    print(min_cost)

Submission status: Wrong Answer

Solution code:
N,T = map(int, input().split())
ct = [list(map(int, input().split())) for i in range(N)]
s_ct = sorted(ct)

for item in s_ct:
    if item[1] <= T:
        print(item[0])
        exit()

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())

a = [list(map(int, input().split())) for i in range(n)]

min = 1001
for x, y in a:
  if x < min and y < t:
    min = x

print(min if min < 1001 else "TLE")

Submission status: Wrong Answer

Solution code:
n,t=map(int,input().split())
a=[]
b=[]
for i in range(n):
  s,t=map(int,input().split())
  a.append(s)
  b.append(t)
c=[]
for j in range(n):
  if b[j]>t:
    c.append(1001)
  else:
    c.append(a[j])
if c==[1001]*n:
  print('TLE')
else:
  print(min(c))

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())

min_c = 1001
for i in range(N):
    c, t = map(int, input().split())
    if t < T and c < min_c:
        min_c = c

if min_c != 1001:
    print(min_c)
else:
    print('TLE')

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())

cost = 1001
for i in range(N):
  c, t = map(int, input().split())
  if t <= T:
    cost = min(cost, t)
  else:
    continue

if cost == 1001:
  print("TLE")
else:
  print(cost)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())

cost = [list(map(int, input().split())) for i in range(N)]

ans = []

for c in cost:
  if c[1] < T+1:
    ans.append(c)
    
if ans != []:
  ans = sorted(ans, key=lambda x: x[1])
  print(ans[0][0])
else:
  print("TLE")

Submission status: Wrong Answer

Solution code:
n,t = map(int,input().split())
ans = 1e10
for i in range(n):
  a,b = map(int,input().split())
  if b <= t:
    ans = min(a,ans)
print(ans)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
flag = False
min_cost = 1000
for i in range(N):
    c,t = map(int, input().split())
    if t < T:
        flag = True
        min_cost = min(c,min_cost)
print(min_cost if flag else "TLE")

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
C=1000
for i in range(N) :
  A,B=map(int,input().split())
  if A<=C and B<=T :
    C=A
if C==1000 :
  print("TLE")
else :
  print(C)

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
C=1000
for i in range(N) :
  A,B=map(int,input().split())
  if A<C and B<=T :
    C=A
if C==1000 :
  print("TLE")
else :
  print(C)

Submission status: Wrong Answer

Solution code:
n,t=map(int,input().split())
d=0
c=1000
for i in range(n):
  a,s=map(int,input().split())
  if s<=t and c>=a:
    c=a
    d=i+1
if d==0:
  print("TLE")
else:
  print(d)

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
l=[]
for i in range(n):
  l.append(list(map(int,input().split())))
c=1000
j=0
for i in range(n):
  if l[i][1]<=m and l[i][0]<c:
    c=l[i][0]
    j=i+1
if j==0:
  print("TLE")
else:  
  print(j)

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
l=[]
for i in range(n):
  l.append(list(map(int,input().split())))
l1=[]
c=1000
j=0
for i in range(n):
  if l[i][1]<=m and l[i][0]<c:
    c=l[i][0]
    j=i+1
print(j)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

n,T = map(int,input().split())
c = [0] * n
t = [0] * n
for i in range(n):
    c[i],t[i] = map(int,input().split())

cost_min = 100000

for i in range(n):
    if cost_min > c[i] and t[i] <= T:
        cost_min = c[i]

if cost_min == -1:
    print("TLE")
else:
    print(cost_min)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

n,T = map(int,input().split())
c = [0] * n
t = [0] * n
for i in range(n):
    c[i],t[i] = map(int,input().split())

cost_min = 100000

for i in range(n):
    if cost_min > c[i] and t[i] <= T:
        cost_min = c[i]

print(cost_min)

Submission status: Wrong Answer

Solution code:
n, t_max = map(int, input().split())
ans = 1000

for i in range(n):
  c, t = map(int, input().split())
  if t <= t_max:
    ans = min(c, ans)
print(ans)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
ans = 1000

for _ in range(N):
    c, t = map(int, input().split())
    if t <= T:
        ans = min(ans, c)
if ans == 1001:
    print("TLE")
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
ans = 1000

for _ in range(N):
    c, t = map(int, input().split())
    if t <= T:
        ans = min(ans, c)
print(ans)

Submission status: Wrong Answer

Solution code:
#coding: utf-8
N, T = map(int, input().split())
ans = T
c = 0
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        c, ans = c, t
print(c if c == 0 else "TLE")

Submission status: Wrong Answer

Solution code:
n,a=map(int,input().split())
ans=1000000000
for i in range(n):
  c,t=map(int,input().split())
  if t<=a:
    ans=min(ans,c)
print(ans)

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
comp = []
for i in range(N):
    nt = [int(i) for i in input().split()]
    comp.append(nt)


cost = []
for i in range(N):
    if comp[i][1] <= T:
        temp = [comp[i][0],comp[i][1]]
        cost.append(temp)
cost = sorted(cost, key = lambda x:x[1])
if cost:
  print(cost[0][0])
else:
  print("TLE")

Submission status: Wrong Answer

Solution code:
n,t=map(int,input().split())
navi=[]
for i in range(n):
  k=list(map(int,input().split()))
navi.sort()
flag=False
for i in navi:
  if i[1]<=t:
    print(i[0])
    flag=True
    break
if flag==False:
  print('TLE')

Submission status: Wrong Answer

Solution code:
n,t=map(int,input().split())
navi=[]
for i in range(n):
  k=list(map(int,input().split()))
navi.sort()
for i in navi:
  if i[1]<=t:
    print(i[0])
    exit()
print('TLE')