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] ABC012 B

問題 B - 入浴時間 回答 N = int(input()) seconds = N % 60 minutes = (N // 60) % 60 hours = N // (60 ** 2) % 60 s_seconds = '{:02d}'.forma...

記事を読む

[Python] 文字列のブルートフォース探索

与えられた文字列の中から、パターンに一致する部分を総当たりで探します。 時間計算量は \( O(n \times m) \)、空間計算量は\( O(1) \) になります。 import random import string def match_pa...

記事を読む

[Python] ABC004

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

記事を読む

[Python] ABC016 A

問題 A - 12月6日 回答 M, D = map(int, input().split()) remainder = M % D if remainder == 0: print('YES') else: print('NO')

記事を読む

[Python] ABC009 C

問題 C - 辞書式順序ふたたび ヒントと解説 (p.32-) が分かりやすいです。 「同じ長さの文字列s, t が与えられたとき、t を並び替えて、s との不一致の数を最小とする」ことを考えるには、結局、「それぞれの文字の数の差」を考えるだけで良い。 ...

記事を読む


Public Domain YottaGin No Rights Reserved.