YottaGin

Freedom is a responsible choice.

[Python] ABC005 A

2019/4/16 プログラミング

問題

A – おいしいたこ焼きの作り方

回答

割り算するだけ。

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

def main():
    X, Y = list(map(int, input().split()))
    ans = Y // X
    print(ans)
    
main()

Atcoder, Python GinO

関連記事

[Python] ABC004

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

記事を読む

[データ構造] 2分探索木の Python での実装

2分探索木を Python で実装します。 以前、ほぼ全く同じ内容で記事を書いています。 ノード 2分探索木では、ノードは自身のデータと、0個、1個、2個のいずれかの子ノードを持っており、左側の子ノードは親の値より小さい値、右...

記事を読む

[Python] ABC020 A

問題 A - クイズ 回答 条件分岐 Q = int(input()) if Q == 1: print('ABC') else: print('chokudai') 三項演算子 Q = int(input()) a...

記事を読む

[Python] ABC012 D ワーシャルフロイド

問題 D - バスと避けられない運命 ワーシャルフロイド ワーシャル–フロイド法(英: Warshall–Floyd Algorithm)は、重み付き有向グラフの全ペアの最短経路問題を多項式時間で解くアルゴリズムである。 出典: フリー百科事典『ウィキペデ...

記事を読む

[Python] ABC002 B

B - 罠 W = input() output = '' for w in W: if w not in 'aiueo': output += w print(output) メモ pythonでは、in を使うと、その文字が含まれる...

記事を読む


Public Domain YottaGin No Rights Reserved.