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] ABC011 C

問題 C - 123引き算 回答 全探索は \( 3^{100} \) であり、難しい。 貪欲法 3を引けるときにそれより小さい数字を引く必要はないので、引ける数のうち最も大きな数字を引けば良い。 N = int(input()) N...

記事を読む

[Python] ABC017 A

問題 A - プロコン 回答 s1, e1 = map(int, input().split()) s2, e2 = map(int, input().split()) s3, e3 = map(int, input().split()) sum_sco...

記事を読む

[Python] ABC016 D

問題 D - 一刀両断 回答 以下が大変参考になりました。 直線と線分 import numpy as np Ax, Ay, Bx, By = map(int, input().split()) N = int(input()) posit...

記事を読む

[Python] ABC017 B

問題 B - choku語 回答 X = input() while X: if len(X)>=2 and X == 'ch': X = X elif X == 'o' or X == 'k' or X == 'u': ...

記事を読む

[統計] 仮説検定

以下の私的まとめです。 Decisions and Uncertainty あるデータが得られたときに、そのデータは偶然によるものなのか、偶然以外のものによるものなのか、どちらか判断するときに、仮説検定という手法を用います。 仮説検定(かせつけんてい、英:hy...

記事を読む


Public Domain YottaGin No Rights Reserved.