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: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n,t=map(int,input().split())
cost_list=[]
for i in range(n):
  cost,time=map(int,input().split())
  if time<=t:
    cost_list+=[cost]
if cost_list!=[]:
  print(min(cost_list))
else:
  print(TLE)

Submission status: Runtime Error

Solution code:
n,t=map(int,input().split())
cost_list=[]
for i in range(n):
  cost,time=map(int,input().split())
  if time<=t:
    cost_list+=cost
if cost_list=![]:
  print(min(cost_list))
else:
  print(TLE)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,T = map(int, input().split())
C = [list(map(int,input().split())) for i in range(N)]
X = sorted(C, key = lambda x:x[1])

i = 0
ans = 1001
while X[i][1] <= T:
  ans = min(ans, X[i][0])
  i += 1

if ans <= 1000:
  print(ans)
else:
  print("TLE")

Submission status: Runtime Error

Solution code:
n,T = map(int,input().split())
ct = [[map(int,input().split())] for _ in range(n)]
cost = 9999
for i in range(n):
    c,t = ct[i][0],ct[i][1]
    if t<=T:
        cost = min(cost,c)
print(cost if cost != 9999 else 'TLE')

Submission status: Runtime Error

Solution code:
n,T = map(int,input().split())
ct = [[map(int,input().split())] for _ in range(n)]
cost = 9999
for i in range(n):
  c,t = ct[i][0],ct[i][1]
  if t<=T:
    cost = min(cost,c)
print(cost if cost != 9999 else 'TLE')

Submission status: Runtime Error

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

routes = []

for i in range(n):
    array = list(map(int, input().split()))
    if array[1] <= t:
        routes.append(array)

if not routes:
    print('TLE')
    exit()

print(min(routes[1]))

Submission status: Runtime Error

Solution code:
n=int(input())
T=int(input())
minimum=10000
for i in range(n):
  c=int(input())
  t=int(input())
  if t <= T :
    minimum = min(minimum,c)
if minimum == 10000:
  print('TLE')
else:
  print(minimum)

Submission status: Runtime Error

Solution code:
n=int(input())
T=int(input())
minimum=10000
for i in range(n):
  c=int(input())
  t=int(input())
  if t <= T :
    minimum = min(minimum,c)
if minimum = 10000:
  print('TLE')
else:
  print(minimum)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
T=int(input())
minimum=1000
for i in range(n):
  c=int(input())
  t=int(input())
  if t <= T :
    minnimum = min(minimum,c)
print(minimum)

Submission status: Runtime Error

Solution code:
Tmp = []
Tmp = input().rstrip().split(' ')
 
nN = int(Tmp[0])
nT = int(Tmp[1])
 
nCost = 1001
nAns = 0
 
for i in range(nN):
  Tmp = input().rstrip().split(' ')
 
  nTmpCost = int(Tmp[0])
  nTmpT = int(Tmp[1])
  
  if nTmpT <= nT and nTmpCost < nCost:
    nCost = nTmpCost
    nAns = i+1
 
if nAns == 0:
  print('TLE')
else:
  print(nCost)
 
#6727236

ソースコード 

Copy
Copy
Tmp = []
Tmp = input().rstrip().split(' ')
 
nN = int(Tmp[0])
nT = int(Tmp[1])
 
nCost = 1001
nAns = 0
 
for i in range(nN):
  Tmp = input().rstrip().split(' ')
 
  nTmpCost = int(Tmp[0])
  nTmpT = int(Tmp[1])
  
  if nTmpT <= nT and nTmpCost < nCost:
    nCost = nTmpCost
    nAns = i+1

if nAns == 0:
  print('TLE')
else:
  print(nCost)

Submission status: Runtime Error

Solution code:
#6727236

ソースコード 

Copy
Copy
Tmp = []
Tmp = input().rstrip().split(' ')
 
nN = int(Tmp[0])
nT = int(Tmp[1])
 
nCost = 1001
nAns = 0
 
for i in range(nN):
  Tmp = input().rstrip().split(' ')
 
  nTmpCost = int(Tmp[0])
  nTmpT = int(Tmp[1])
  
  if nTmpT <= nT and nTmpCost < nCost:
    nCost = nTmpCost
    nAns = i+1

if nAns == 0:
  print('TLE')
else:
  print(nCost)

Submission status: Runtime Error

Solution code:
Tmp = []
Tmp = input().rstrip().split(' ')
 
nN = int(Tmp[0])
nT = int(Tmp[1])
 
nCost = 1001
nAns = 0
 
for i in range(nN):
  Tmp = input().rstrip().split(' ')
 
  nTmpCost = int(Tmp[0])
  nTmpT = int(Tmp[1])
  
  if nTmpT =< nT and nTmpCost < nCost:
    nCost = nTmpCost
    nAns = i+1

if nAns == 0:
  print('TLE')
else:
  print(nCost)

Submission status: Runtime Error

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

min_cost = 1001  # 最小コストを入れる変数。初期値は制約上のMAX + 1 にしておく
for cost, time in zip(costs, times):
    if time <= t and cost < min_cost:
        min_cost = cost

if min_cost < 1000:
    print(min_cost)
else:
    print('TLE')

Submission status: Runtime Error

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]:
        minCost = data[i][0]

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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: Runtime Error

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

for i in list1:
  if int(i[1]) <= int(t):
    list2.append(i)

list2.sort()
print(list2[0][0])

Submission status: Runtime Error

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

costs = list(filter(lambda x: x[1] <= T, ct))
if len(costs) == 0:
  print('TLE')
else:
  costs.sort(key=lambda x: x[0])
  print(costs[0][2])

Submission status: Runtime Error

Solution code:
n,T=[int(i) for i in input().split()]
ans=[]
for i in range(n):
  c,t=[int(i) for i in input().split()]
  if t<=T:
    ans.append(c)
print(min(ans) if len(c)!=0 else "TLE")

Submission status: Runtime Error

Solution code:
n,t = map(int, input().split())
l = []
for _ in range(n):
  i, c = map(int, input().split())
  if not c => j:
    l.append([c, j])
l.sort(key=lambda x: x[1])
print(l[0][0])

Submission status: Runtime Error

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

Submission status: Runtime Error

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)
print(min(paths))

Submission status: Runtime Error

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)
print(min(paths))

Submission status: Runtime Error

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)
print(min(paths))

Submission status: Runtime Error

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("TLE" if m == 1005 else ans)

Submission status: Runtime Error

Solution code:
N,T = int(input())
min_cost = 1001

for i in range(N):
    l = input()
    if l[1] <= T:
        if l[0] < min_cost:
            min_cost = l[0]

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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
  elif t==min_t:
    if ans>c:
      ans=c
print(ans)

Submission status: Runtime Error

Solution code:
#制限時間以内でコストの最小のものを選ぶ
n,t=map(int,input().split())
v=[list(map(int,list(input().split()))) for i in range(n)]
list=[]
for i in range(n):
    if v[i][1] <= t:
        list.append(v[i][0])
if list==0:
    print("TLE")
else:
    print(min(list))

Submission status: Runtime Error

Solution code:
N, T = [int(x) for x in input().strip()]

ok = 2000
for _ in range(N):
  c, t = [int(x) for x in input().strip()]
  if t <= T:
    ok = min(ok, c)

print("TLE" if ok == 2000 else ok)

Submission status: Runtime Error

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]
print(least)

Submission status: Runtime Error

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)
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: Runtime Error

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

c_list = []

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

print(min(c_list))

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split())
r = [tuple(map(int, input().split())) for _ in range(N)]
f = [(c, t) for c, t in r if t <= T]
print(min(f, key=lambda x: x[0])[0])

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split())
r = [tuple(map(int, input().split())) for _ in range(n)]
f = [(c, t) for c, t in r if t <= T]
print(min(f, key=lambda x: x[0]))

Submission status: Runtime Error

Solution code:
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
ans=1001
for i in range(n):
  if ct[n][1]<=t and ct[n][0]<=ans:
    ans=ct[n][0]
if ans<1001:
  print(ans)
else:
  print("TLE")

Submission status: Runtime Error

Solution code:
n,t=map(int,input().spplit())
ct=[list(map(int,input().split())) for i in range(n)]
ans=1001
for i in range(n):
  if ct[n][1]<=t and ct[n][0]<=ans:
    ans=ct[n][0]
if ans<1001:
  print(ans)
else:
  print("TLE")

Submission status: Runtime Error

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:list_c.append(c) else:max_t=t
print("TLE" if max_t==T else min(list_c))

Submission status: Runtime Error

Solution code:
n,t=map(int,input().split())
clis=[]
tlis=[]
for i in range(n):
  a,b=map(int,input().split())
  clis.append(a)
  tlis.append(b)
lis2=[]
for i in range(n):
  if tlis[i] > t:
    pass
  else:
    lis2.append(clis[i])
if len(lis2)==0:
  print(TLE)
else:
  print(min(lis2))

Submission status: Runtime Error

Solution code:
N,T = (int(x) for x in input().split())
n = []
t = []
for i in range(0,N):
  a,b = (int(x) for x in input().split())
  n.append(a)
  t.append(b)
  
under_t = (index for index,i in enumerate(t) if i <= T)
result = sorted(n[i] for i in under_t)[0]
print(result)

Submission status: Runtime Error

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

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

for i in range(N):
  if t[i] < T:
    hoge.append(c[i])
print(min(hoge))

Submission status: Runtime Error

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
print(min(w_dic, key=w_dic.get))

Submission status: Runtime Error

Solution code:
n, t = map(int, input().split())
cost = []
for i in range(n):
    c, ti = map(int, input().split())
    if ti <= t:
        cost.append(c)
cost = sorted(cost)
print(cost[0])

Submission status: Runtime Error

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

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

a = [x for x, y in zip(c, t) if y <= T]
if len(a) > 0:
  print(min(a))
else:
  print('TLE')

Submission status: Runtime Error

Solution code:
N,Time=map(int,input().split())
C=[]
T=[]
for _ in range(N):
    c,t=map(int,input().split())
    C.append(c)
    T.append(t)

tmp=[]
for i in range(N):
    if T[i]<=Time:
        tmp.append(C[i])
print(min(tmp))

if tmp==[]:
    print('TLE')

Submission status: Runtime Error

Solution code:
N,T = map(int,input().split())
t = 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: Runtime Error

Solution code:
#include <iostream>
using namespace std;

int main() {
	int N, T; cin >> N >> T;
	
	bool isTLE = 1;
	int mi=1001;
	for(int i=0; i<N; i++){
		int c, t; cin >> c >>t;
		if(t <= T) {
			if(c < mi) mi = c;
			isTLE = 0;
		}
	}
	
	if(isTLE) cout << "TLE";
	else cout << mi;
	cout << endl;
	
	
	return 0;
}

Submission status: Runtime Error

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

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

C.sort()
print(C[0])

Submission status: Runtime Error

Solution code:
N,T = map(int,input().split())
c,t = [list(map(int,input.split())) for i in N]
min_c = 1000
hantei = 0
ans = 0
for i in N:
  tmp = 0
  if t[i] <= T:
    tmp = 1
    hantei += 1
  if tmp == 1:
    if c[i] < min_c:
      min_c = c[i]
      ans = i+1
print ans if hantei>0 else 'TLE'

Submission status: Runtime Error

Solution code:
N,T = map(int,input().split())
c,t = [list(map(int,input.split())) for i in N]
min_c = 1000
hantei = 0
ans = 0
for i in N:
  tmp = 0
  if t[i] <= T:
    tmp = 1
    hantei += 1
  if tmp == 1:
    if c[i] < min_c:
      min_c = c[i]
      ans = i+1
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
h = list(map(int, input().split()))
ans = 1

for i in range(1, n):
    if max(h[:i]) <= h[i]:
        ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
N,T=map(int,list(input().split()))
c=1001
for i in range(N):
  ct,tc=map(int,list(input().split()))
  if T>=tc and c>=ct:
    c=ct
  if c==1001:
    c="TLE"
print(c)

Submission status: Runtime Error

Solution code:
N,T=map(int,input().split())
List=[list(input().split()) for i in range(N)]
List2=[]
List3=[]
for i in List:
        List2.append([int(s) for s in i])
for i in List2:
        if i[1] <= T:
                List3.append(i[0])
        else:
                List3.append("TLE")
print(min(List3))

Submission status: Runtime Error

Solution code:
N,T=map(int,input().split())
List=[list(input().split()) for i in range(N)]
List2=[]
List3=[]
for i in List:
        List2.append([int(s) for s in i])
for i in List2:
        if i[1] <= T:
                List3.append(i[0])
print(min(List3))

Submission status: Runtime Error

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)
min_time_index = time.index(min(time))
print(cost[min_time_index])

Submission status: Runtime Error

Solution code:
n,t=map(int,input().split())
a=[]
b=[]
for i in range(n):
  a.append(int(input()))
  b.append(int(input()))
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: Runtime Error

Solution code:
n,t=map(int,input().split());c=[]
for i in range(n):
  a,b=map(int,input().split())
  if b<=t:
    c.append(a)
c.sort();print(c[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

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])
print(cost[0][0])

Submission status: Runtime Error

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)
print(comp)


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])
print(cost[0][0])

Submission status: Runtime Error

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.sort()
print(cost[0][1])

Submission status: Runtime Error

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N,T = [int(x) for x in input().split]
cost = []
for _ in range(N):
    c,t = [int(x) for x in input().split]
    if t <= T:
        cost.append(c)

if cost == True:
    print(min(cost))
else:
    print("TLE")

Submission status: Runtime Error

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N,T = [int(x) for x in input().split]
cost = []
for _ in range(n):
    c,t = [int(x) for x in input().split]
    if t <= T:
        cost.append(c)

if cost == True:
    print(min(cost))
else:
    print("TLE")

Submission status: Runtime Error

Solution code:
N,T=map(int,input().split(' '))
costs = []
for i in range(N):
  c,t = map(int,input().split(' '))
  if t<=T:
    costs.append(c)
print(min(costs))

Submission status: Runtime Error

Solution code:
data = input().split()
N = int(data[0])
T = int(data[1])
c = []
t = []
i = 0
j = 0
while i < N:
  sc = input().split()
  c.append(int(sc[0]))
  t.append(int(sc[1]))
  i += 1

mn = min(t)
if mn > T:
  print("TLE")
else:
  mn = c[0]
  while j < N:
    if t[j] <= T:
      
      if mn > c[j]:
        mn = c[j]
        ind = j
        
    j += 1

  print(c[ind])

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split())
min_c = 10**5
for n in range(N):
    c, t = map(int, input().split())
    if t <= T:
        min_c = min(min_c, c)

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

Submission status: Runtime Error

Solution code:
a,b,k=map(int, input().split())
cnt=0
for i in range(min(a,b)+1,0,-1):
    if a%i==0 and b%i==0:
        cnt+=1
        if cnt==k:
            print(i)

Submission status: Runtime Error

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

ct = [int(j) for j in input().split() for i in range(H)]

ct.sort(key=lambda x: x[0])

ans = 1001

for i in range(N):
    if ct[i][1] <= T:
        ans = ct[i][0]
        break

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

Submission status: Runtime Error

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

for i in l:
  if int(i[1]) < t:
    print(i[0])
    exist = True
    break
if !(exist):
  print("TLE")

Submission status: Runtime Error

Solution code:
n,t=map(int,input().split())
l=[]
for i in range(n):
    c,time=map(int,input().split())
    if time>=t:
        l.append(c)
print(min(l))

Submission status: Runtime Error

Solution code:
def solve(string):
    n, t, *ct = map(int, string.split())
    c = [_c for _c, _t in zip(ct[::2], ct[1::2]) if _t <= t]
    return str(min(c)) if len(c) else "TLE"


if __name__ == '__main__':
    n, t = map(int, input().split())
    print(solve("{} {}\n".format(n, t) + "\n".join([input() for _ in n])))

Submission status: Runtime Error

Solution code:
def solve(string):
    n, t, *ct = map(int, string.split())
    c = [_c for _c, _t in zip(ct[::2], ct[1::2]) if _t <= t]
    return str(min(c)) if len(c) else "TLE"


if __name__ == '__main__':
    n, t = map(int, input())
    print(solve("{} {}\n".format(n, t) + "\n".join([input() for _ in n])))

Submission status: Runtime Error

Solution code:
A, B = map(int,input().split())
cost = list()
m = B + 1
for i in range(A):
  x, y = map(int, input().split())
  if y < min:
    m = y
    cost.append(x)
print(min(cost) if m <= B else 'TLE')

Submission status: Runtime Error

Solution code:
N,T = list(map(int, raw_input().split()))
c = [0] * N
t = [0] * N
for i in range(0,N):
	c[i],t[i] = list(map(int, raw_input().split()))

c = zip(c,t)
c.sort()
c,t = zip(*c)

for i,ci in enumerate(c) :
	if t[i] <= T :
		break
else:
	i += 1

if i == N :
	print("TLE")
else:
	print(ci)

Submission status: Runtime Error

Solution code:
#cording: utf-8

N, T = map(int, input().split())

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

if len(c) != 0:
    print(min(c))
else:
    print('TEL')

Submission status: Runtime Error

Solution code:
#cording: utf-8

N, T = map(int, input().split())

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

c_min = 1001
for i in range(N):
    if (ct[i][1] <= T) and (ct[i][0] <= c_min):
        c_min = ct[i][0]

print(minc if minc != 1001 else 'TLE')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,T=map(int,input())
res=2000
for i in N:
  c,t=map(int,input())
  if t>T:
    continue
  else:
    res=min(res,c)
if res=2000:
  print("TLE")
else:
  print(res)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n, time = map(int, input().split())
list = []
list_ok = []
for i in range(n):
    c, t = map(int, input().split())
    object = [c, t]
    list.append(object)

for j in range(n):
    if list[j][1] > time:
        continue
    else:
        list_ok.append(list[j][0])

ans = min(list_ok)

print(ans)

Submission status: Runtime Error

Solution code:
n, time = map(int, input().split())
list = []
list_ok = []
for i in range(n):
    c, t = map(int, input().split())
    object = [c, t]
    list.append(object)
    
print(list)

for j in range(n):
    if list[j][1] > time:
        continue
    else:
        list_ok.append(list[j][0])

ans = min(list_ok)

print(ans)

Submission status: Runtime Error

Solution code:
n,T=map(int,input().split())
a = []
for i in range(n):
  A,t=map(int,input().split())
  if t > T:
    pass
  else:
    a.append(A)
print(min(a))

Submission status: Runtime Error

Solution code:
n, t = map(int, input())
ct = [map(int(input())) for _ in range(n)]

li = []
for i in range(n):
  if ct[i][1] < t:
    li.append(ct[i])
  else:
    continue

if count(li) > 0:
  print(min(li[:][0]))
else:
  print("TLE")

Submission status: Runtime Error

Solution code:
n, t =map(int, input().split())
l = [tuple(map(int, input().split())) for i in range(n)]
m = sorted([i for i in l if i[1] <= t])
print(m[0][0])

Submission status: Runtime Error

Solution code:
n,t = list(map(int,input().split()))
in_time = list()
           
for i in range(n):
    a,b =  list(map(int,input().split()))
    if t >= b:
        in_time.append(a)
        
print(min(in_time))

Submission status: Runtime Error

Solution code:
N,T = map(int,input().split())
paths = list()
for i in range(N):
  ci,ti = map(int,input().split())
  paths.append((ci,ti))
paths.sort(key=lambda x: x[0])

for path in paths:
  if path[1] <= T:
    print(path[0])
    exit(1)
print('TLE')

Submission status: Runtime Error

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

C=[]

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

    if t<=T:
        C.append(c)

print(min(C))

Submission status: Runtime Error

Solution code:
N,T = map(int,input().split())
ans = [c for c,t in sorted([(input().split()) for i in range(N)],key=lambda x :x[1]) if int(t)<=T][0]
if len(ans)!=0:
    print(ans)
else:
    print("TLE")

Submission status: Runtime Error

Solution code:
N,T = map(int,input().split())
ans = [c for c,t in sorted([(input().split()) for i in range(N)],key=lambda x :x[1]) if int(t)<=T][-1]
if len(ans)!=0:
    print(ans)
else:
    print("TLE")

Submission status: Runtime Error

Solution code:
N,T=map(int, input().split())
ans=9999
for i inrange(N):
  A,B=map(int, input().split())
  if (T>B):
    if(ans>A):
      ans=A
if(ans==9999):
  print("TLE")
else:
  print(ans)

Submission status: Runtime Error

Solution code:
N,T=map(int,input().split())
li = [list(map(int,input().split())) for i in range(N)]
t_cost=[T - li[i][1] for i in range(N)]
if(all(x < 0 for x in t_cost)):
  print('TLE')
else:
  t_cost_1=[]
  for i in range(N):
    if(t_cost[i]>=0):
      t_cost_1.append(i)
    else:
  print(min([li[t_cost_1[i]][0] for i in range(len(t_cost_1))]))

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split())
c = []
t = []
for i in range(N):
    tmp1, tmp2 = map(int, input().split())
    c.append(tmp1)
    t.append(tmp2)

tmp_min = float('inf')

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

if tmp_min == float('inf'):
    print('TLE')
else tmp_min<=T:
    print(int(tmp_min))

Submission status: Runtime Error

Solution code:
N, T = input().split()
N, T = int(N), int(T)
R = [input().split() for i in range(N)]

for i, r in enumerate(R):
  R[i] = [int(r[0]), int(r[1])]

R_sorted = sorted(R, key = lambda x: x[0])

List = []
answer = 'TLE'

for r in R_sorted:
  if r[1] <= T:
    List.append(r[0])

print(min(List))

Submission status: Runtime Error

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

for i in range(N):
  c, tt==list(map(int, input().split()))
  if tt <= T:
    ans=min(c,ans)

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

Submission status: Runtime Error

Solution code:
N, T = map(int,input())
tmp=10000
ans=0

for i in range(N):
  c, tt==map(int,input())
  if tt <= T:
    tmp=min(c,tmp)
    if c==ans:
      ans=i

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

Submission status: Runtime Error

Solution code:
N, T = map(int,input())
ans=10000

for i in range(N):
  c, tt==map(int,input())
  if tt <= T:
    ans=min(c,ans)

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

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
l = []
for _ in range(a):
  x, y = map(int, input().split())
  if y <= b:
    l.append(x)
print(min(l))

Submission status: Runtime Error

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

for i in range(n):
    c,s = map(int,input().split())
    if s <= t:
        d.append(c)
if d == 0:
    print("TLE")
else:
    print(min(d))

Submission status: Runtime Error

Solution code:
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
a=[]
for j in ct:
  if j[1]<t:
    a.append(j[0])
print(min(a))

Submission status: Runtime Error

Solution code:
n, t = map(int, input().split())
CT = [list(map(int, input().split())) for i in range(n)]
ct = []
for j in range(n):
  if CT[j][1] <= t:
    ct.append(CT[j])
ct = sorted(ct)
print(ct[0][0])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,T = map(int,input().split())
dic = {}
for i in range(N):
    dic[int(input())] = int(input())
L = sorted(dic.dict_keys)
for i in range(N):
    if dic[i] <T:
        print(L[i])
        break
print("TLE")

Submission status: Runtime Error

Solution code:
N,T = map(int,input().split())
a= [map(int,input().split()) for i in range(N)]
b = []
for i in range(N):
    b.append(a[i][0])
L = sorted(b)
i = 0
while i < N:
    if L[i] < T:
        print(L[i])
        break
    else:
        i = i+1
        continue
if i == N:
    print("TLE")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,T = map(int,input().split())
for i in range(N):
  dic  = {int(input()):int(input())}
a = sorted(dic.get())
for i in range(N):
  if dic[a[i]] <= T:
    print(a[i])
  else:
    continue