output_description stringlengths 15 956 | submission_id stringlengths 10 10 | status stringclasses 3 values | problem_id stringlengths 6 6 | input_description stringlengths 9 2.55k | attempt stringlengths 1 13.7k | problem_description stringlengths 7 5.24k | samples stringlengths 2 2.72k |
|---|---|---|---|---|---|---|---|
Print the answer.
* * * | s138067743 | Wrong Answer | p03813 | The input is given from Standard Input in the following format:
x | X = int(input())
ans = X // 11
if X % 11 == 0:
print(ans * 2)
elif X % 11 < 7:
print(ans * 2 + 1)
else:
print(ans * 2 + 2)
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s670129052 | Accepted | p03813 | The input is given from Standard Input in the following format:
x | print("AARBCC"["1200" > input() :: 2])
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s803405670 | Accepted | p03813 | The input is given from Standard Input in the following format:
x | print("A" + ["R", "B"][int(input()) < 1200] + "C")
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s326088292 | Accepted | p03813 | The input is given from Standard Input in the following format:
x | [print(["ARC", "ABC"][int(input()) < 1200])]
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s067420093 | Wrong Answer | p03813 | The input is given from Standard Input in the following format:
x | print("A{'RB'[int(input())<1200]}C")
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s294989556 | Wrong Answer | p03813 | The input is given from Standard Input in the following format:
x | print("A%sC" % "RB"["13" > input()])
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s197932107 | Runtime Error | p03813 | The input is given from Standard Input in the following format:
x | print("ABC" if int(input) < 1200 else "ARC")
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s511252272 | Wrong Answer | p03813 | The input is given from Standard Input in the following format:
x | print(["ABC", "ARC"][int(input()) > 1200])
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s820079935 | Wrong Answer | p03813 | The input is given from Standard Input in the following format:
x | print("A{'BR'[int(input())<1200]}C")
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s066399046 | Runtime Error | p03813 | The input is given from Standard Input in the following format:
x | print(f"A{RB[input()<"1200"]}C") | Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s920527595 | Runtime Error | p03813 | The input is given from Standard Input in the following format:
x | print("A"+"RB"[int(input())<1200)]+"C") | Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s310355824 | Wrong Answer | p03813 | The input is given from Standard Input in the following format:
x | print(["ABC", "ARC"][int(input()) < 1200])
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s286650460 | Wrong Answer | p03813 | The input is given from Standard Input in the following format:
x | print(("ABC", "ARC")[int(input()) < 1200])
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s654716081 | Runtime Error | p03813 | The input is given from Standard Input in the following format:
x | print("ARC" if int(input) > 1200 else "ABC")
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s945024671 | Wrong Answer | p03813 | The input is given from Standard Input in the following format:
x | print("A" + "BR"[int(input()) < 1200] + "C")
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s399417300 | Wrong Answer | p03813 | The input is given from Standard Input in the following format:
x | print("A%sC" % "RB"["121" > input()])
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s617415465 | Wrong Answer | p03813 | The input is given from Standard Input in the following format:
x | print("ABC" if 1200 < int(input()) else "ARC")
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s028677660 | Runtime Error | p03813 | The input is given from Standard Input in the following format:
x | x=int(input())
print("ABC" x<1200 else "ARC") | Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s444963692 | Runtime Error | p03813 | The input is given from Standard Input in the following format:
x | x = int(input()
print('ARC' if x >= 1200 else 'ABC')
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s955417531 | Runtime Error | p03813 | The input is given from Standard Input in the following format:
x | print(("ARC","ABC")[int(input()<1200]) | Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s301552515 | Wrong Answer | p03813 | The input is given from Standard Input in the following format:
x | print("ARC" if int(input()) > 1200 else "ABC")
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s356807417 | Wrong Answer | p03813 | The input is given from Standard Input in the following format:
x | print(["ABC", "ARC"][int(int(input()) < 1200)])
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s728079381 | Runtime Error | p03813 | The input is given from Standard Input in the following format:
x | x=int(input(())
if x<1200:
print(ABC)
else:
print(ARC) | Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s359497577 | Runtime Error | p03813 | The input is given from Standard Input in the following format:
x | a=int(input())
if(a<1200):
print("ABC")
else:
print("ARC)
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s479702740 | Accepted | p03813 | The input is given from Standard Input in the following format:
x | print("ARC") if int(input()) >= 1200 else print("ABC")
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s497252390 | Runtime Error | p03813 | The input is given from Standard Input in the following format:
x | if int(input())>=1200:
print("ARC")
else print("ABC") | Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s590893427 | Runtime Error | p03813 | The input is given from Standard Input in the following format:
x | print(“ABC” if int(input())<1200 else(“ARC”))
| Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s305437268 | Runtime Error | p03813 | The input is given from Standard Input in the following format:
x | print("A{}C".format("B" if int(input()<1200 else "R")) | Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the answer.
* * * | s071753719 | Runtime Error | p03813 | The input is given from Standard Input in the following format:
x | if int(input())>=1200:
print("ARC")
else print("ABC") | Statement
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his
current rating is less than 1200, and participate in AtCoder Regular Contest
(ARC) otherwise.
You are given Smeke's current rating, x. Print `ABC` if Smeke will participate
in ABC, and print `ARC` otherwise. | [{"input": "1000", "output": "ABC\n \n\nSmeke's current rating is less than 1200, thus the output should be `ABC`.\n\n* * *"}, {"input": "2000", "output": "ARC\n \n\nSmeke's current rating is not less than 1200, thus the output should be `ARC`."}] |
Print the number of kinds of items you got.
* * * | s736178912 | Wrong Answer | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | num = int(input()) - 1
j = 0
target = input()
hit = 1
x = 0
while j <= num - 1:
check = input()
if target in check and len(target) == len(check):
x += 1
else:
hit += 1
target = check
j += 1
print(hit)
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s664294063 | Accepted | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | times = int(input())
item = []
for i in range(times):
item.append(input())
uniq_list = list(set(item))
print(len(uniq_list))
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s088997068 | Accepted | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | list1 = []
number = int(input())
for i in range(0, number):
numbers = input()
list1.append(numbers)
setOfMarks = set(list1)
print(len(setOfMarks))
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s652410063 | Accepted | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | print(len(set(open(0))) - 1)
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s915629484 | Accepted | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | n = int(input())
lists = [input() for i in range(n)]
s_list = set(lists)
print(len(s_list))
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s340220304 | Wrong Answer | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | S = input()
from collections import Counter
def solve(S):
n = len(S)
cum = [0] * (n + 1)
for i in range(n):
cum[i + 1] = (cum[i] + int(S[n - 1 - i]) * 10**i) % 2019
c = Counter(cum)
ans = 0
for v in c.values():
ans += v * (v - 1) // 2
return ans
print(solve(S))
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s537866707 | Wrong Answer | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | # multiple
line = input()
n = len(line)
total = 0
for i in range(n - 3):
for j in range(i + 3, n):
if int(line[i : j + 1]) % 2019 == 0:
total += 1
print(total)
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s950269187 | Accepted | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | print(len({input() for i in range(int(input()))}))
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s708534094 | Accepted | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | print(len({*open(0)}) - 1)
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s216908895 | Runtime Error | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | N = int(input())
arr = []
for i in range(N):
arr.append(input())
print(len(set(arr)) | Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s077335446 | Wrong Answer | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | a, lists = int(input()), list(map(str, input().split()))
print(len(list(set(lists))))
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s014354863 | Runtime Error | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | n = int(input().split())
mylist = list(range(0))
inp = ""
for i in range(n):
inp = input()
if inp not in mylist:
mylist.append(inp)
print(len(mylist))
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s156530305 | Accepted | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | row = int(input())
item_list = [input() for i in range(row)]
print(len(set(item_list)))
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s454357338 | Accepted | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | import sys
input_methods = ["clipboard", "file", "key"]
using_method = 0
input_method = input_methods[using_method]
IN = lambda: map(int, input().split())
LIN = lambda: list(IN())
mod = 1000000007
# +++++
def main():
a = int(input())
# b , c = IN()
al = [input() for _ in range(a)]
# s = input()
n = len(list(set(al)))
print(n)
# +++++
isTest = False
def pa(v):
if isTest:
print(v)
def input_clipboard():
import clipboard
input_text = clipboard.get()
input_l = input_text.splitlines()
for l in input_l:
yield l
if __name__ == "__main__":
if sys.platform == "ios":
if input_method == input_methods[0]:
ic = input_clipboard()
input = lambda: ic.__next__()
elif input_method == input_methods[1]:
sys.stdin = open("inputFile.txt")
else:
pass
isTest = True
else:
pass
# input = sys.stdin.readline
ret = main()
if ret is not None:
print(ret)
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s396961477 | Accepted | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | print(len(set(input() for i in range(int(input())))))
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s768711769 | Accepted | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | n = int(input())
sss = [input() for _ in range(n)]
sss = list(set(sss))
print(len(sss))
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s679956718 | Accepted | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | print(len({input().strip() for _ in range(int(input().strip()))}))
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s155878928 | Accepted | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | import sys
from io import StringIO
import unittest
def resolve():
n = int(input())
s = [input() for _ in range(n)]
print(len(set(s)))
class TestClass(unittest.TestCase):
def assertIO(self, input, output):
stdout, stdin = sys.stdout, sys.stdin
sys.stdout, sys.stdin = StringIO(), StringIO(input)
resolve()
sys.stdout.seek(0)
out = sys.stdout.read()[:-1]
sys.stdout, sys.stdin = stdout, stdin
self.assertEqual(out, output)
def test_入力例_1(self):
input = """3
apple
orange
apple"""
output = """2"""
self.assertIO(input, output)
def test_入力例_2(self):
input = """5
grape
grape
grape
grape
grape"""
output = """1"""
self.assertIO(input, output)
def test_入力例_3(self):
input = """4
aaaa
a
aaa
aa"""
output = """4"""
self.assertIO(input, output)
if __name__ == "__main__":
# unittest.main()
resolve()
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s867280758 | Runtime Error | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | n = int(input())
a = [["" for i in range(10)] for j in range(26)]
dic = [
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"p",
"q",
"r",
"s",
"t",
"u",
"v",
"w",
"x",
"y",
"z",
]
ans = 0
for i in range(n):
b = input()
p = dic.index(b[0])
q = len(b)
if b not in a[p][q]:
a[p][q] += b
ans += 1
print(ans)
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s759804636 | Accepted | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | numOfStr = int(input())
strlist = []
total = 1
for i in range(0, numOfStr):
strlist.append(input())
strlist.sort()
for i in range(1, numOfStr):
if strlist[i] != strlist[i - 1]:
total += 1
print(total)
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s445224658 | Accepted | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | n = int(input())
s = [str(input()) for i in range(n)]
uni = set(s)
print(len(uni))
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Print the number of kinds of items you got.
* * * | s892035967 | Accepted | p02701 | Input is given from Standard Input in the following format:
N
S_1
:
S_N | i = int(input())
gift = dict()
# print(gift.get('aaa'))
for i in range(i):
value = input()
# print(value)
# print(gift.get(value))
if gift.get(value) == None:
gift[value] = 1
else:
gift[value] += 1
# print(gift)
print(len(gift))
| Statement
You drew lottery N times. In the i-th draw, you got an item of the kind
represented by a string S_i.
How many kinds of items did you get? | [{"input": "3\n apple\n orange\n apple", "output": "2\n \n\nYou got two kinds of items: `apple` and `orange`.\n\n* * *"}, {"input": "5\n grape\n grape\n grape\n grape\n grape", "output": "1\n \n\n* * *"}, {"input": "4\n aaaa\n a\n aaa\n aa", "output": "4"}] |
Find the minimum time that Snuke needs to have slimes in all N colors.
* * * | s047029925 | Accepted | p04006 | The input is given from Standard Input in the following format:
N x
a_1 a_2 ... a_N | class SegmentTree(object):
def __init__(self, A, dot, unit):
n = 1 << (len(A) - 1).bit_length()
tree = [unit] * (2 * n)
for i, v in enumerate(A):
tree[i + n] = v
for i in range(n - 1, 0, -1):
tree[i] = dot(tree[i << 1], tree[i << 1 | 1])
self._n = n
self._tree = tree
self._dot = dot
self._unit = unit
def __getitem__(self, i):
return self._tree[i + self._n]
def update(self, i, v):
i += self._n
self._tree[i] = v
while i != 1:
i >>= 1
self._tree[i] = self._dot(self._tree[i << 1], self._tree[i << 1 | 1])
def add(self, i, v):
self.update(i, self[i] + v)
def sum(self, l, r): # これで[l,r)から取り出す。
l += self._n
r += self._n
l_val = r_val = self._unit
while l < r:
if l & 1:
l_val = self._dot(l_val, self._tree[l])
l += 1
if r & 1:
r -= 1
r_val = self._dot(self._tree[r], r_val)
l >>= 1
r >>= 1
return self._dot(l_val, r_val)
N, x = map(int, input().split())
INF = float("inf")
A = list(map(int, input().split()))
A = A + A
Tree = SegmentTree(A, min, INF)
ans = INF
for kaisu in range(N):
temp = kaisu * x
for i in range(N):
right = 2 * N - i
left = right - (kaisu + 1)
temp += Tree.sum(left, right)
ans = min(ans, temp)
print(ans)
| Statement
Snuke lives in another world, where slimes are real creatures and kept by some
people. Slimes come in N colors. Those colors are conveniently numbered 1
through N. Snuke currently has no slime. His objective is to have slimes of
all the colors together.
Snuke can perform the following two actions:
* Select a color i (1≤i≤N), such that he does not currently have a slime in color i, and catch a slime in color i. This action takes him a_i seconds.
* Cast a spell, which changes the color of all the slimes that he currently has. The color of a slime in color i (1≤i≤N-1) will become color i+1, and the color of a slime in color N will become color 1. This action takes him x seconds.
Find the minimum time that Snuke needs to have slimes in all N colors. | [{"input": "2 10\n 1 100", "output": "12\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Cast the spell. The color of the slime changes: 1 \u2192 2. This takes 10 seconds.\n * Catch a slime in color 1. This takes 1 second.\n\n* * *"}, {"input": "3 10\n 100 1 100", "output": "23\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 2. This takes 1 second.\n * Cast the spell. The color of the slime changes: 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n * Cast the soell. The color of each slime changes: 3 \u2192 1, 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n\n* * *"}, {"input": "4 10\n 1 2 3 4", "output": "10\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Catch a slime in color 2. This takes 2 seconds.\n * Catch a slime in color 3. This takes 3 seconds.\n * Catch a slime in color 4. This takes 4 seconds."}] |
Find the minimum time that Snuke needs to have slimes in all N colors.
* * * | s913414137 | Wrong Answer | p04006 | The input is given from Standard Input in the following format:
N x
a_1 a_2 ... a_N | import sys
from collections import defaultdict as dd
input = sys.stdin.readline
N, x = map(int, input().split())
a = list(map(int, input().split()))
res = float("inf")
import heapq
class prim:
def __init__(self, n, e):
self.e = e
self.n = n
def MSTcost(self):
h = []
visited = [0] * (self.n + 1)
ks = list(self.e.keys())
b = pow(10, 10)
for edge in self.e[ks[0]]:
heapq.heappush(h, edge[1] * b + edge[0])
res = 0
visited[ks[0]] = 1
while len(h):
p = heapq.heappop(h)
p0 = p // b
p1 = p % b
if visited[p1]:
continue
visited[p1] = 1
for q in self.e[p1]:
if visited[q[0]]:
continue
heapq.heappush(h, q[1] * b + q[0])
res += p0
return res
e = dd(list)
for k in range(N + 1):
for i in range(N):
e[N].append(((i + k) % N, a[i]))
pri = prim(N, e)
res = min(res, pri.MSTcost() + k * x)
print(res)
| Statement
Snuke lives in another world, where slimes are real creatures and kept by some
people. Slimes come in N colors. Those colors are conveniently numbered 1
through N. Snuke currently has no slime. His objective is to have slimes of
all the colors together.
Snuke can perform the following two actions:
* Select a color i (1≤i≤N), such that he does not currently have a slime in color i, and catch a slime in color i. This action takes him a_i seconds.
* Cast a spell, which changes the color of all the slimes that he currently has. The color of a slime in color i (1≤i≤N-1) will become color i+1, and the color of a slime in color N will become color 1. This action takes him x seconds.
Find the minimum time that Snuke needs to have slimes in all N colors. | [{"input": "2 10\n 1 100", "output": "12\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Cast the spell. The color of the slime changes: 1 \u2192 2. This takes 10 seconds.\n * Catch a slime in color 1. This takes 1 second.\n\n* * *"}, {"input": "3 10\n 100 1 100", "output": "23\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 2. This takes 1 second.\n * Cast the spell. The color of the slime changes: 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n * Cast the soell. The color of each slime changes: 3 \u2192 1, 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n\n* * *"}, {"input": "4 10\n 1 2 3 4", "output": "10\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Catch a slime in color 2. This takes 2 seconds.\n * Catch a slime in color 3. This takes 3 seconds.\n * Catch a slime in color 4. This takes 4 seconds."}] |
Find the minimum time that Snuke needs to have slimes in all N colors.
* * * | s438824229 | Accepted | p04006 | The input is given from Standard Input in the following format:
N x
a_1 a_2 ... a_N | N, X = [int(_) for _ in input().split()]
A = [int(_) for _ in input().split()]
def solve0(N, X, A):
A2 = A + A
T = [[min(A2[N + j + 1 - i - 1 : N + j + 1]) for j in range(N)] for i in range(N)]
mins = [sum(T[i]) + i * X for i in range(N)]
result = min(mins)
return result
def solve(N, X, A):
M = A[:]
result = sum(M)
for i in range(1, N):
M = [min(M[j], A[(j - i) % N]) for j in range(N)]
r = sum(M) + X * i
result = min(result, r)
return result
print(solve(N, X, A))
| Statement
Snuke lives in another world, where slimes are real creatures and kept by some
people. Slimes come in N colors. Those colors are conveniently numbered 1
through N. Snuke currently has no slime. His objective is to have slimes of
all the colors together.
Snuke can perform the following two actions:
* Select a color i (1≤i≤N), such that he does not currently have a slime in color i, and catch a slime in color i. This action takes him a_i seconds.
* Cast a spell, which changes the color of all the slimes that he currently has. The color of a slime in color i (1≤i≤N-1) will become color i+1, and the color of a slime in color N will become color 1. This action takes him x seconds.
Find the minimum time that Snuke needs to have slimes in all N colors. | [{"input": "2 10\n 1 100", "output": "12\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Cast the spell. The color of the slime changes: 1 \u2192 2. This takes 10 seconds.\n * Catch a slime in color 1. This takes 1 second.\n\n* * *"}, {"input": "3 10\n 100 1 100", "output": "23\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 2. This takes 1 second.\n * Cast the spell. The color of the slime changes: 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n * Cast the soell. The color of each slime changes: 3 \u2192 1, 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n\n* * *"}, {"input": "4 10\n 1 2 3 4", "output": "10\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Catch a slime in color 2. This takes 2 seconds.\n * Catch a slime in color 3. This takes 3 seconds.\n * Catch a slime in color 4. This takes 4 seconds."}] |
Find the minimum time that Snuke needs to have slimes in all N colors.
* * * | s213339495 | Wrong Answer | p04006 | The input is given from Standard Input in the following format:
N x
a_1 a_2 ... a_N | def getN():
return int(input())
def getNM():
return map(int, input().split())
def getList():
return list(map(int, input().split()))
n, x = getList()
nums = getList()
ans = 0
waits = []
def custmin(tgt):
tc, ts = 1000000000, 0
for cost, spell in tgt:
if cost < tc:
tc, ts = cost, spell
elif cost == tc and ts < spell:
tc, ts = cost, spell
return tc, ts
for i, c in enumerate(nums):
target = [(tgt + x * ((j + n - i) % n), j) for j, tgt in enumerate(nums)]
cost, wait = custmin(target)
ans += nums[wait]
waits.append((wait + n - i) % n)
print(ans + max(waits) * x)
| Statement
Snuke lives in another world, where slimes are real creatures and kept by some
people. Slimes come in N colors. Those colors are conveniently numbered 1
through N. Snuke currently has no slime. His objective is to have slimes of
all the colors together.
Snuke can perform the following two actions:
* Select a color i (1≤i≤N), such that he does not currently have a slime in color i, and catch a slime in color i. This action takes him a_i seconds.
* Cast a spell, which changes the color of all the slimes that he currently has. The color of a slime in color i (1≤i≤N-1) will become color i+1, and the color of a slime in color N will become color 1. This action takes him x seconds.
Find the minimum time that Snuke needs to have slimes in all N colors. | [{"input": "2 10\n 1 100", "output": "12\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Cast the spell. The color of the slime changes: 1 \u2192 2. This takes 10 seconds.\n * Catch a slime in color 1. This takes 1 second.\n\n* * *"}, {"input": "3 10\n 100 1 100", "output": "23\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 2. This takes 1 second.\n * Cast the spell. The color of the slime changes: 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n * Cast the soell. The color of each slime changes: 3 \u2192 1, 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n\n* * *"}, {"input": "4 10\n 1 2 3 4", "output": "10\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Catch a slime in color 2. This takes 2 seconds.\n * Catch a slime in color 3. This takes 3 seconds.\n * Catch a slime in color 4. This takes 4 seconds."}] |
Find the minimum time that Snuke needs to have slimes in all N colors.
* * * | s291176970 | Wrong Answer | p04006 | The input is given from Standard Input in the following format:
N x
a_1 a_2 ... a_N | n, x = map(int, input().split())
a = [int(x) for x in input().split()]
d = None
s = 0
for i, k in enumerate(a):
m = 10**9 + 1
e = None
f = None
for j, l in enumerate(a):
z = i - j
if z < 0:
z += n
c = a[j] + z * x
if c < m:
m = c
e = z
f = a[j]
s += f
if d is None or d < e:
d = e
s += d * x
print(s)
| Statement
Snuke lives in another world, where slimes are real creatures and kept by some
people. Slimes come in N colors. Those colors are conveniently numbered 1
through N. Snuke currently has no slime. His objective is to have slimes of
all the colors together.
Snuke can perform the following two actions:
* Select a color i (1≤i≤N), such that he does not currently have a slime in color i, and catch a slime in color i. This action takes him a_i seconds.
* Cast a spell, which changes the color of all the slimes that he currently has. The color of a slime in color i (1≤i≤N-1) will become color i+1, and the color of a slime in color N will become color 1. This action takes him x seconds.
Find the minimum time that Snuke needs to have slimes in all N colors. | [{"input": "2 10\n 1 100", "output": "12\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Cast the spell. The color of the slime changes: 1 \u2192 2. This takes 10 seconds.\n * Catch a slime in color 1. This takes 1 second.\n\n* * *"}, {"input": "3 10\n 100 1 100", "output": "23\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 2. This takes 1 second.\n * Cast the spell. The color of the slime changes: 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n * Cast the soell. The color of each slime changes: 3 \u2192 1, 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n\n* * *"}, {"input": "4 10\n 1 2 3 4", "output": "10\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Catch a slime in color 2. This takes 2 seconds.\n * Catch a slime in color 3. This takes 3 seconds.\n * Catch a slime in color 4. This takes 4 seconds."}] |
Find the minimum time that Snuke needs to have slimes in all N colors.
* * * | s311325659 | Wrong Answer | p04006 | The input is given from Standard Input in the following format:
N x
a_1 a_2 ... a_N | n, x = map(int, input().split())
a = list(map(int, input().split()))
m = a.index(min(a))
a = a[m:] + a[:m]
sorta = [i for i, t in enumerate(a)]
a = [[i, False] for i in a]
ans = 10**14
for p in sorta:
a[p][1] = True
temp = 0
maxx = 0
cnt = 0
for i, j in a:
if j:
now = i
m = max(maxx, cnt)
cnt = 0
else:
cnt += 1
temp += now
maxx = max(maxx, cnt)
temp += x * maxx
ans = min(ans, temp)
print(ans)
| Statement
Snuke lives in another world, where slimes are real creatures and kept by some
people. Slimes come in N colors. Those colors are conveniently numbered 1
through N. Snuke currently has no slime. His objective is to have slimes of
all the colors together.
Snuke can perform the following two actions:
* Select a color i (1≤i≤N), such that he does not currently have a slime in color i, and catch a slime in color i. This action takes him a_i seconds.
* Cast a spell, which changes the color of all the slimes that he currently has. The color of a slime in color i (1≤i≤N-1) will become color i+1, and the color of a slime in color N will become color 1. This action takes him x seconds.
Find the minimum time that Snuke needs to have slimes in all N colors. | [{"input": "2 10\n 1 100", "output": "12\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Cast the spell. The color of the slime changes: 1 \u2192 2. This takes 10 seconds.\n * Catch a slime in color 1. This takes 1 second.\n\n* * *"}, {"input": "3 10\n 100 1 100", "output": "23\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 2. This takes 1 second.\n * Cast the spell. The color of the slime changes: 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n * Cast the soell. The color of each slime changes: 3 \u2192 1, 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n\n* * *"}, {"input": "4 10\n 1 2 3 4", "output": "10\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Catch a slime in color 2. This takes 2 seconds.\n * Catch a slime in color 3. This takes 3 seconds.\n * Catch a slime in color 4. This takes 4 seconds."}] |
Find the minimum time that Snuke needs to have slimes in all N colors.
* * * | s426600292 | Wrong Answer | p04006 | The input is given from Standard Input in the following format:
N x
a_1 a_2 ... a_N | # gcdは3.4.3だとfractionsにある
from fractions import gcd
from math import factorial as f
from math import ceil, floor, sqrt
from sys import exit
from copy import deepcopy
import numpy as np
import bisect
import re
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(map(int, input().split()))
def main():
n, x = mi()
a = li()
flag = [0 for i in range(n)]
for i in range(1, n):
if a[i - 1] + x < a[i]:
a[i] = min(a[i - 1] + x, a[i])
flag[i] = 1
if a[n - 1] + x < a[0]:
a[0] = min(a[n - 1] + x, a[0])
flag[0] = 1
for i in range(1, n):
if a[i - 1] + x < a[i]:
a[i] = min(a[i - 1] + x, a[i])
flag[i] = 1
if a[n - 1] + x < a[0]:
a[0] = min(a[n - 1] + x, a[0])
flag[0] = 1
for i in range(1, n):
if a[i - 1] + x < a[i]:
a[i] = min(a[i - 1] + x, a[i])
flag[i] = 1
if a[n - 1] + x < a[0]:
a[0] = min(a[n - 1] + x, a[0])
flag[0] = 1
a = a + a
flag = flag + flag
p = 0
while flag[p] == 1:
p += 1
po = p
p += 1
ans = 0
while p < n or flag[p] == 1:
if flag[p] == 0:
ans += a[po] * (p - po)
ans += (p - po - 1) * x
po = p
p += 1
ans += a[po] * (p - po)
ans += (p - po - 1) * x
print(ans)
main()
| Statement
Snuke lives in another world, where slimes are real creatures and kept by some
people. Slimes come in N colors. Those colors are conveniently numbered 1
through N. Snuke currently has no slime. His objective is to have slimes of
all the colors together.
Snuke can perform the following two actions:
* Select a color i (1≤i≤N), such that he does not currently have a slime in color i, and catch a slime in color i. This action takes him a_i seconds.
* Cast a spell, which changes the color of all the slimes that he currently has. The color of a slime in color i (1≤i≤N-1) will become color i+1, and the color of a slime in color N will become color 1. This action takes him x seconds.
Find the minimum time that Snuke needs to have slimes in all N colors. | [{"input": "2 10\n 1 100", "output": "12\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Cast the spell. The color of the slime changes: 1 \u2192 2. This takes 10 seconds.\n * Catch a slime in color 1. This takes 1 second.\n\n* * *"}, {"input": "3 10\n 100 1 100", "output": "23\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 2. This takes 1 second.\n * Cast the spell. The color of the slime changes: 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n * Cast the soell. The color of each slime changes: 3 \u2192 1, 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n\n* * *"}, {"input": "4 10\n 1 2 3 4", "output": "10\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Catch a slime in color 2. This takes 2 seconds.\n * Catch a slime in color 3. This takes 3 seconds.\n * Catch a slime in color 4. This takes 4 seconds."}] |
Find the minimum time that Snuke needs to have slimes in all N colors.
* * * | s915166934 | Wrong Answer | p04006 | The input is given from Standard Input in the following format:
N x
a_1 a_2 ... a_N | from sys import stdin
n, x = map(int, stdin.readline().split())
cout = list(map(int, stdin.readline().split()))
indiceMin = 0
for i in range(n):
if cout[indiceMin] > cout[i]:
indiceMin = i
total = 0
for i in range(n):
indice = (indiceMin + i) % n
minimum = cout[indice]
if indice != indiceMin:
minimum = min(minimum, cout[indiceMin] + x)
total += minimum
print(total)
| Statement
Snuke lives in another world, where slimes are real creatures and kept by some
people. Slimes come in N colors. Those colors are conveniently numbered 1
through N. Snuke currently has no slime. His objective is to have slimes of
all the colors together.
Snuke can perform the following two actions:
* Select a color i (1≤i≤N), such that he does not currently have a slime in color i, and catch a slime in color i. This action takes him a_i seconds.
* Cast a spell, which changes the color of all the slimes that he currently has. The color of a slime in color i (1≤i≤N-1) will become color i+1, and the color of a slime in color N will become color 1. This action takes him x seconds.
Find the minimum time that Snuke needs to have slimes in all N colors. | [{"input": "2 10\n 1 100", "output": "12\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Cast the spell. The color of the slime changes: 1 \u2192 2. This takes 10 seconds.\n * Catch a slime in color 1. This takes 1 second.\n\n* * *"}, {"input": "3 10\n 100 1 100", "output": "23\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 2. This takes 1 second.\n * Cast the spell. The color of the slime changes: 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n * Cast the soell. The color of each slime changes: 3 \u2192 1, 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n\n* * *"}, {"input": "4 10\n 1 2 3 4", "output": "10\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Catch a slime in color 2. This takes 2 seconds.\n * Catch a slime in color 3. This takes 3 seconds.\n * Catch a slime in color 4. This takes 4 seconds."}] |
Find the minimum time that Snuke needs to have slimes in all N colors.
* * * | s170961821 | Runtime Error | p04006 | The input is given from Standard Input in the following format:
N x
a_1 a_2 ... a_N | n,x=map(int,input().split())
a=list(map(int,input().split()))
dp=[a[i] for i in range(n)]
sp_cnt[0 for i in range(n)]
for i in range(1,n):
if a[n-i]+i*x<dp[0]:
dp[0]=a[n-1]+i*x
sp_cnt[0]=i
for i in range(1,n):
for j in range(i):
if a[i-j]+j*x<dp[0]:
dp[i]=a[i-j]+j*x
sp_cnt[i]=max(sp_cnt[i],j)
all_sp_cnt=sum(sp_cnt)
max_sp_cnt=max(sp_cnt)
ans=sum(dp)-(all_sp_cnt-max_sp_cnt)*x
print(ans) | Statement
Snuke lives in another world, where slimes are real creatures and kept by some
people. Slimes come in N colors. Those colors are conveniently numbered 1
through N. Snuke currently has no slime. His objective is to have slimes of
all the colors together.
Snuke can perform the following two actions:
* Select a color i (1≤i≤N), such that he does not currently have a slime in color i, and catch a slime in color i. This action takes him a_i seconds.
* Cast a spell, which changes the color of all the slimes that he currently has. The color of a slime in color i (1≤i≤N-1) will become color i+1, and the color of a slime in color N will become color 1. This action takes him x seconds.
Find the minimum time that Snuke needs to have slimes in all N colors. | [{"input": "2 10\n 1 100", "output": "12\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Cast the spell. The color of the slime changes: 1 \u2192 2. This takes 10 seconds.\n * Catch a slime in color 1. This takes 1 second.\n\n* * *"}, {"input": "3 10\n 100 1 100", "output": "23\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 2. This takes 1 second.\n * Cast the spell. The color of the slime changes: 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n * Cast the soell. The color of each slime changes: 3 \u2192 1, 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n\n* * *"}, {"input": "4 10\n 1 2 3 4", "output": "10\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Catch a slime in color 2. This takes 2 seconds.\n * Catch a slime in color 3. This takes 3 seconds.\n * Catch a slime in color 4. This takes 4 seconds."}] |
Find the minimum time that Snuke needs to have slimes in all N colors.
* * * | s755121868 | Runtime Error | p04006 | The input is given from Standard Input in the following format:
N x
a_1 a_2 ... a_N | N, x = list(map(int, input().split()))
a = list(map(int, input().split()))
min_index = a.index(min(a))
index_list = list(range(min_index,N)) + list(range(min_index))
cost = a.copy()
c_count = [0]*N
for i in range(1,N):
if cost[index_list[i]] => (cost[index_list[i-1]]+x):
cost[index_list[i]] = cost[index_list[i-1]]+x
c_count[index_list[i]] = c_count[index_list[i-1]]+1
print(sum(cost) - sum(c_count)*x + max(c_count)*x )
| Statement
Snuke lives in another world, where slimes are real creatures and kept by some
people. Slimes come in N colors. Those colors are conveniently numbered 1
through N. Snuke currently has no slime. His objective is to have slimes of
all the colors together.
Snuke can perform the following two actions:
* Select a color i (1≤i≤N), such that he does not currently have a slime in color i, and catch a slime in color i. This action takes him a_i seconds.
* Cast a spell, which changes the color of all the slimes that he currently has. The color of a slime in color i (1≤i≤N-1) will become color i+1, and the color of a slime in color N will become color 1. This action takes him x seconds.
Find the minimum time that Snuke needs to have slimes in all N colors. | [{"input": "2 10\n 1 100", "output": "12\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Cast the spell. The color of the slime changes: 1 \u2192 2. This takes 10 seconds.\n * Catch a slime in color 1. This takes 1 second.\n\n* * *"}, {"input": "3 10\n 100 1 100", "output": "23\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 2. This takes 1 second.\n * Cast the spell. The color of the slime changes: 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n * Cast the soell. The color of each slime changes: 3 \u2192 1, 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n\n* * *"}, {"input": "4 10\n 1 2 3 4", "output": "10\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Catch a slime in color 2. This takes 2 seconds.\n * Catch a slime in color 3. This takes 3 seconds.\n * Catch a slime in color 4. This takes 4 seconds."}] |
Find the minimum time that Snuke needs to have slimes in all N colors.
* * * | s519734963 | Runtime Error | p04006 | The input is given from Standard Input in the following format:
N x
a_1 a_2 ... a_N | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mx = 4005;
const ll inf = 4e18;
ll dp[mx], rdp[mx];
ll a[mx];
ll x;
int n;
int main(){
ios_base::sync_with_stdio(false);cin.tie(0);
cin >> n >> x;
for(int i = 0; i < n; i++) cin >> a[i];
copy(a,a+n,a+n);
for(int i = 0; i < 2 * n; i++){
dp[i] = min((i ? dp[i-1] : inf) + x, a[i]);
}
for(int i = 2 * n; i--; ){
rdp[i] = min((i < 2*n-1 ? dp[i+1] : inf) + x, a[i]);
}
ll ans = 0;
for(int i = 0; i < n; i++){
ans += min({dp[i],dp[n+i],rdp[i],rdp[n+i]});
}
cout << ans << '\n';
}
| Statement
Snuke lives in another world, where slimes are real creatures and kept by some
people. Slimes come in N colors. Those colors are conveniently numbered 1
through N. Snuke currently has no slime. His objective is to have slimes of
all the colors together.
Snuke can perform the following two actions:
* Select a color i (1≤i≤N), such that he does not currently have a slime in color i, and catch a slime in color i. This action takes him a_i seconds.
* Cast a spell, which changes the color of all the slimes that he currently has. The color of a slime in color i (1≤i≤N-1) will become color i+1, and the color of a slime in color N will become color 1. This action takes him x seconds.
Find the minimum time that Snuke needs to have slimes in all N colors. | [{"input": "2 10\n 1 100", "output": "12\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Cast the spell. The color of the slime changes: 1 \u2192 2. This takes 10 seconds.\n * Catch a slime in color 1. This takes 1 second.\n\n* * *"}, {"input": "3 10\n 100 1 100", "output": "23\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 2. This takes 1 second.\n * Cast the spell. The color of the slime changes: 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n * Cast the soell. The color of each slime changes: 3 \u2192 1, 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n\n* * *"}, {"input": "4 10\n 1 2 3 4", "output": "10\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Catch a slime in color 2. This takes 2 seconds.\n * Catch a slime in color 3. This takes 3 seconds.\n * Catch a slime in color 4. This takes 4 seconds."}] |
Find the minimum time that Snuke needs to have slimes in all N colors.
* * * | s176083350 | Wrong Answer | p04006 | The input is given from Standard Input in the following format:
N x
a_1 a_2 ... a_N | N, X = map(int, input().split())
(*A,) = map(int, input().split())
a = min(A)
S = [x for x in range(N) if A[x] <= X + a]
B = [0] * N
ans = 0
for i in S:
if B[i] == 0:
ans += A[i]
B[i] = 1
while not all(B):
B = [B[-1]] + B[:-1]
ans += X
for i in S:
if B[i] == 0:
ans += A[i]
B[i] = 1
print(ans)
| Statement
Snuke lives in another world, where slimes are real creatures and kept by some
people. Slimes come in N colors. Those colors are conveniently numbered 1
through N. Snuke currently has no slime. His objective is to have slimes of
all the colors together.
Snuke can perform the following two actions:
* Select a color i (1≤i≤N), such that he does not currently have a slime in color i, and catch a slime in color i. This action takes him a_i seconds.
* Cast a spell, which changes the color of all the slimes that he currently has. The color of a slime in color i (1≤i≤N-1) will become color i+1, and the color of a slime in color N will become color 1. This action takes him x seconds.
Find the minimum time that Snuke needs to have slimes in all N colors. | [{"input": "2 10\n 1 100", "output": "12\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Cast the spell. The color of the slime changes: 1 \u2192 2. This takes 10 seconds.\n * Catch a slime in color 1. This takes 1 second.\n\n* * *"}, {"input": "3 10\n 100 1 100", "output": "23\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 2. This takes 1 second.\n * Cast the spell. The color of the slime changes: 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n * Cast the soell. The color of each slime changes: 3 \u2192 1, 2 \u2192 3. This takes 10 seconds.\n * Catch a slime in color 2. This takes 1 second.\n\n* * *"}, {"input": "4 10\n 1 2 3 4", "output": "10\n \n\nSnuke can act as follows:\n\n * Catch a slime in color 1. This takes 1 second.\n * Catch a slime in color 2. This takes 2 seconds.\n * Catch a slime in color 3. This takes 3 seconds.\n * Catch a slime in color 4. This takes 4 seconds."}] |
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.
* * * | s105588701 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | n,t = map(int, input().split())
a = []
cost = float(10000)
for i in range(n):
a,b = list(map(int, input().split()))
if b <= t:
cost = min(cost, a)
print('TLE' if cost == 10000 else co | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s714625081 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | N,T = map(int,input().split())
min = 1001
for ii in ranga(N):
c,t = map(int,input().split())
if t <= T:
min = c if min > c:
if t == 1001:
print('TLE')
else:
print(min)
| 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s163544231 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | N,T=map(int,input().split())
ans=100000
for _ in range(N):
c,t=map(int,input().split())
if t<=T:
ans=min(ans,c)
print('TLE' if ans=100000 else ans) | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s733318746 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | n, tx = input().strip().split(' ')
n, tx = [int(n),int(tx)]
c_ans = 1001
for i in range (n):
c, t = input().strip().split(' ')
c, t = [int(c),int(t)]
if c < c_ans and t =< tx:
c_ans = c
if c_ans == 1001:
print('TLE')
else:
print(c_ans)
| 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s402465165 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | N, T = [int(i) for i in input().split()]
min_cost = 1001
for c, t in [input().split() for _ in range(N)]
c, t = int(c), int(t)
if t > T:
continue
min_cost = min(min_cost, c)
ans = min_cost if min_cost < 1001 else "TLE"
print(ans) | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s189351024 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | 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))])) | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s606414084 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | 4 3
1 1000
2 4
3 1000
4 500 | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s625316466 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | import sys
import math
import collections
import itertools
import array
import inspect
# Set max recursion limit
sys.setrecursionlimit(1000000)
# Debug output
def chkprint(*args):
names = {
id(v): k
for k, v in inspect.currentframe().f_back.f_locals.items()
}
print(', '.join(
names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))
# Binary converter
def to_bin(x):
return bin(x)[2:]
def li_input():
return [int(_) for _ in input().split()]
def gcd(n, m):
if n % m == 0:
return m
else:
return gcd(m, n % m)
def gcd_list(L):
v = L[0]
for i in range(1, len(L)):
v = gcd(v, L[i])
return v
def lcm(n, m):
return (n * m) // gcd(n, m)
def lcm_list(L):
v = L[0]
for i in range(1, len(L)):
v = lcm(v, L[i])
return v
# Width First Search (+ Distance)
def wfs_d(D, N, K):
"""
D: 隣接行列(距離付き)
N: ノード数
K: 始点ノード
"""
dfk = [-1] * (N + 1)
dfk[K] = 0
cps = [(K, 0)]
r = [False] * (N + 1)
r[K] = True
while len(cps) != 0:
n_cps = []
for cp, cd in cps:
for i, dfcp in enumerate(D[cp]):
if dfcp != -1 and not r[i]:
dfk[i] = cd + dfcp
n_cps.append((i, cd + dfcp))
r[i] = True
cps = n_cps[:]
return dfk
# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
"""
v: 現在のノード
pre: 1つ前のノード
dist: 現在の距離
以下は別途用意する
D: 隣接リスト(行列ではない)
D_dfs_d: dfs_d関数で用いる,始点ノードから見た距離リスト
"""
global D
global D_dfs_d
D_dfs_d[v] = dist
for next_v, d in D[v]:
if next_v != pre:
dfs_d(next_v, v, dist + d)
return
def sigma(N):
ans = 0
for i in range(1, N + 1):
ans += i
return ans
def comb(n, r):
if n - r < r: r = n - r
if r == 0: return 1
if r == 1: return n
numerator = [n - r + k + 1 for k in range(r)]
denominator = [k + 1 for k in range(r)]
for p in range(2, r + 1):
pivot = denominator[p - 1]
if pivot > 1:
offset = (n - r) % p
for k in range(p - 1, r, p):
numerator[k - offset] /= pivot
denominator[k] /= pivot
result = 1
for k in range(r):
if numerator[k] > 1:
result *= int(numerator[k])
return result
def bisearch(L, target):
low = 0
high = len(L) - 1
while low <= high:
mid = (low + high) // 2
guess = L[mid]
if guess == target:
return True
elif guess < target:
low = mid + 1
elif guess > target:
high = mid - 1
if guess != target:
return False
# --------------------------------------------
dp = None
def main():
N, T = li_input()
A = []
for i in range(N):
A.append(li_input())
ans = 9999999999999999999
for a in A:
c, t = a
if t <= T and c < ans:
ans = c
if ans != 9999999999999999999
print(ans)
else:
print("TLE")
main()
| 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s560865752 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | n,t = map(int,input().split())
m = 10000
for i in range(n):
c,d = map(int,input().split())
if d <= t:
if m > c:
m = c
if m = 10000:
print('TLE')
else:
print(m) | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s285758279 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | n, T = map(int, input().split())
c, t = [map(int, input().split() for i in range(n))]
k = []
if all(t) > T:
print("TLE")
else:
for i in range(n):
if t[i] <= T:
k.append(c[j])
print(min(k))
| 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s119543108 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | n, t = map(int, input().split())
ans = float('inf')
for i in range(n):
c, t2 = map(int, input().split())
if t2 <= t:
ans = min(ans, c)
print('TLE' if ans = float('inf') else c) | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s937914191 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | N, T = map(int, input().split())
cage,cage2=[],[]
for i in range(N):
c, t = map(int, input().split())
if t<=T:
cage.append(c)
cage2.append(n)
if cage==None:
print("TLE")
else:
print(soted(cage)[0]) | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s230426699 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | n,T = list(map(int,input().split()))
ans = 10000
for i in range(n):
c,t = map(int,input().split())
if(t<=T):
ans=min(ans,c)
else:
None
if(ans = 10000):
print("TLE")
else:
print(ans)
| 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s365924834 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | 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) | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s160323763 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | 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") | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s755236188 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | A=[]
while True:
try:
A.append(list(map(int,input().split())))
except:
break;
#2列めがT以下で且つ、コストが最小なものを抽出
min = A[1][1] #最小を7とす
for i in range(1, len(A)):
j = int(i)
if A[j][1] =< A[0][1]:
if A[j][0] < min:
min = A[j][0]
if min < A[0][1]:
print(min)
else:
print("TLE")
| 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s355714090 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | def main():
N,T= (int(i) for i in input().split())
A=[]
B=[]
for i in range(N):
ai,bi= (int(j) for j in input().split())
A.append(ai)
B.append(bi)
if (min(A)) <= T:
print(min((A))
else:
print("TLE")
main() | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s285199794 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | n,t = map(int,input().split())
ct = [list(map(int,input().split())) for i in range(n)]
T = []
for h in range(n):
T.append(ct[i][1])
if min(T) > t:
print("TLE")
exit()
else:
for j in range(n):
if ct[j][1] <= t:
c = ct[j][0]
k = j
break
for i in range(k+1,n):
if ct[i][1] <= t:
c = min(c,ct[i][0])
print(c) | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s836341860 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | 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) | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s328120690 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | Base = input().split(" ")
N = int(Base[0])
TL = int(Base[1])
TX = 10000
for i in range(N):
Roi = input().split(" ")
Coi = int(Roi[0])
TLi = int(Roi[1])
if TL >= TLi:
if TX >= int(Coi) or i ==0:
TX = Coi
if TX == 10000:
print("TLE")
elif:
print(TX) | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s481882677 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | N,T=map(int,input().split())
root=[tuple(map(int,input().split())) for i in range(N)]
minc=1000
for cand in root:
if cand[1]<=T:
if cand[0]<minc:
minc=cand[0]
if minc==1000:
print("TLE")
else:
print(minc) | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s644686371 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | N,T=map(int,input().split())
root=[tuple(map(int,input().split())) for i in range(N)]
minc=1000
for cand in root(N):
if cand[1]<=T:
if cand[0]<minc:
minc=cand[0]
if minc==1000:
print("TLE")
else:
print(minc) | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s526614591 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | N,T = map(int,input().split())
ct = list()
for _ in range(N):
s, t = map(int,i)nput().split
if t <= T:
ct.append(s, t)
#ct = [input().split() for _ in range(N)]
| 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s355118062 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | ans = 1001
N,T = map(int,input().split())
for i in range(N):
c,t = map(int,input().split())
if t <= T and c <= ans:
ans = c
if ans = 1001:
print("TLE")
else:
print(ans) | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s288478456 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | 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])
| 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s289656657 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | 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 | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s042817448 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | 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]) | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s706947256 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | 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) | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s857392839 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | N, T = map(int, input().split())
li = [list(map(int, input().split())) for i in range(N)]
li2 = []
if
for s in li:
if s[0:] <= T:
li2 = li2.append(s)
for t in li2:
minli = min(li2[:1])
print(minli)
else:
print("TLE") | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s509813038 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | # -*- coding: utf-8 -*-
n,t = map(int,input().split())
ans_no = 0
ans_cost = t
for i in range(n):
a,b = map(int,input().split())
if b<ans_cost:
ans_no = a
if ans_no = 0:
print("TLE")
else print(ans_no) | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s653147446 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | 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) | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s485739103 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | N, T = map(int, input().split())
ans = 1001
for i in range(N):
c, t = map(int, input().split())
if t > T:
continue
if ans > c:
ans = c
if ans = 1001:
print('TLE')
else:
print(ans)
| 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s062485861 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | N, T = map(int, input().split())
ans = 1001
for i in range(n):
c, t = map(int, input().split())
if t > T:
continue
if ans > c:
ans = c
if ans = 1001:
print('TLE')
else:
print(ans)
| 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s647356400 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | N, T = map(int, input().split())
cage,cage2=[],[]
for n,i in enumerate(N):
c, t = map(int, input().split())
if t<=T:
cage.append(c)
cage2.append(n)
if cage==None:
print("TLE")
else:
print(soted(cage)[0] | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s627382183 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | N,T=input().split()
a=0
b=0
for i in range(int(N)):
c,t=input().split()
if int(t)<=int(T):
if b==0:
a=c
b+=1
if int(c)<int (a):
a=c
i+=1
if a==0: | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s913106093 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | def input_N_T():
N_T=input().split()
int_N_T=list(map(int,N_T))
N=int_N_T[0]
T=int_N_T[1]
return [N,T]
N,T=input_N_T()
min_c,min_t=1001,1001
for i in range(N):
c,t=input_N_T()
if(t<=T and min(min_c,c)==c):
min_c,min_t=c,t
if(N==1001 and T==1001):
print("TLE")
else:
print(c) | 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
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.
* * * | s189715851 | Runtime Error | p03239 | Input is given from Standard Input in the following format:
N T
c_1 t_1
c_2 t_2
:
c_N t_N | 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))
| 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. | [{"input": "3 70\n 7 60\n 1 80\n 4 50", "output": "4\n \n\n * The first route gets him home at cost 7.\n * The second route takes longer than time T = 70.\n * The third route gets him home at cost 4.\n\nThus, the cost 4 of the third route is the minimum.\n\n* * *"}, {"input": "4 3\n 1 1000\n 2 4\n 3 1000\n 4 500", "output": "TLE\n \n\nThere is no route that takes not longer than time T = 3.\n\n* * *"}, {"input": "5 9\n 25 8\n 5 9\n 4 10\n 1000 1000\n 6 1", "output": "5"}] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.