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

C - 入れ替え n = int(input()) n = n % 30 lst_num = for i in range(n): first = i % 5 + 1 second = i % 5 +2 lst_num, lst_num =...

記事を読む

[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] デコレーターについて

Python のデコレーターについて理解するための個人的なまとめです。 デコレーター 8.6. 関数定義 @f1(arg) @f2 def func(): pass は大体次と等価です。 def func(): pass func = f1(arg...

記事を読む

[Python] MS Access .mdbファイルにアクセスする

Windows上で、Pythonからマイクロソフトのアクセスファイルを扱うために、pyodbcを使います。 pyodbc pyodbcは、PythonからODBCを通してデータベースを操作するライブラリです。SQL構文でデータベースとやりとりができます。 Py...

記事を読む

[Python] ABC020 A

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

記事を読む


Public Domain YottaGin No Rights Reserved.