YottaGin

Freedom is a responsible choice.

[Python] ABC005 B

2019/4/16 アルゴリズム, プログラミング

問題

B – おいしいたこ焼きの食べ方

回答

リストの中から最小値を取り出す。

import sys
# input処理を高速化する
input = sys.stdin.readline

def main():
    N = int(input())
    lst_t = [int(input()) for _ in range(N)] 

    ans = min(lst_t)
    print(ans)
    
main()

Atcoder, Python GinO

関連記事

[Python] ABC016 B

問題 B - A±B Problem 回答 A, B, C = map(int, input().split()) sum_ab = A + B diff_ab = A - B if sum_ab == C and diff_ab == C: ...

記事を読む

[Python] ABC018 D 100点

問題 D – バレンタインデー 回答 女子の組み合わせ、男子の組み合わせを全て列挙すると\( {}_{18} C _9 \times {}_{18} C _9 \)、女子の組み合わせだけを列挙しその組み合わせに対してチョコをもらう...

記事を読む

[Python] N桁のビット列を全て求める

問題 N桁のビット列を全て求めなさい。 回答 その1 def apped_zero_one_front(x, L): return def bit_strings(n): if n == 0: return [] ...

記事を読む

[Python] ABC012 D ダイクストラ法

問題 D - バスと避けられない運命 回答 ダイクストラ法を使います。 Python では TLE でしたが、PyPy では AC でした。 import collections import sys import heapq N, ...

記事を読む

[Python] ABC004

B - 回転 table = [] while True: try: table.append(list(input().split())) except: break table = table #print(table) table_180...

記事を読む


Public Domain YottaGin No Rights Reserved.