YottaGin

Freedom is a responsible choice.

[Python] ABC014 A

2019/12/6 2019/12/6 プログラミング

問題

A – けんしょう先生のお菓子配り

回答

a = int(input())
b = int(input())

remainder = a % b

shortage = 0
if remainder > 0:
    shortage = b - remainder

print(shortage)

Atcoder, Python GinO

関連記事

[Python] ABC018 C 100点 いもす法

問題 C – 菱型カウント 回答 スライドの解説に従うとTLEになってしまいました。 以下を参考にして、いもす法を用いました。 ABC018 C - 菱型カウント # 参照 R, C, K = map(int, input()...

記事を読む

[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] multiprocessingを試す (1)

multiprocessing multiprocessing とは、プロセスベースで並列処理を行う python の bulid-in モジュールです。 処理を並列に行えるので、処理が速くなります。 multiprocessing--- プロセスベースの並列...

記事を読む

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

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

記事を読む

[Python] ABC019 A

問題 A - 高橋くんと年齢 回答 abc = list(map(int, input().split())) print(sorted(abc))

記事を読む


Public Domain YottaGin No Rights Reserved.