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 A

A - 流行 n = int(input()) print(n*2) さすがに簡単。

記事を読む

[Python] NLTKを使ってみる (5) Sentiment Analysis 感情分析

以下の続きです。 以下参考にしています。 Python NLTK: Twitter Sentiment Analysis Sentiment Analysis 感情分析 Sentiment analysis(also known as...

記事を読む

[Python] アナグラムかどうか確認する

Python で与えられた文がアナグラムかどうか確認します。 アナグラム(anagram)とは、言葉遊びの一つで、単語または文の中の文字をいくつか入れ替えることによって、全く別の意味にさせる遊びである。 出典: フリー百科事典『ウィキペディア(Wikipedia...

記事を読む

[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] ABC003 B

B - AtCoderトランプ s = input() t = input() commercial_at = flag = True for i in range(len(s)): if s == t: continue elif ...

記事を読む


Public Domain YottaGin No Rights Reserved.