結果

問題 No.2194 兄弟の掛け引き
ユーザー ttomo2023ttomo2023
提出日時 2023-03-30 12:55:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 96 ms / 1,000 ms
コード長 344 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 11,872 KB
実行使用メモリ 10,096 KB
最終ジャッジ日時 2023-10-21 23:39:07
合計ジャッジ時間 1,541 ms
ジャッジサーバーID
(参考情報)
judge12 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,096 KB
testcase_01 AC 24 ms
10,096 KB
testcase_02 AC 27 ms
10,096 KB
testcase_03 AC 26 ms
10,096 KB
testcase_04 AC 25 ms
10,096 KB
testcase_05 AC 27 ms
10,096 KB
testcase_06 AC 25 ms
10,096 KB
testcase_07 AC 26 ms
10,096 KB
testcase_08 AC 25 ms
10,096 KB
testcase_09 AC 27 ms
10,096 KB
testcase_10 AC 25 ms
10,096 KB
testcase_11 AC 24 ms
10,096 KB
testcase_12 AC 25 ms
10,096 KB
testcase_13 AC 28 ms
10,096 KB
testcase_14 AC 96 ms
10,096 KB
testcase_15 AC 25 ms
10,096 KB
testcase_16 AC 25 ms
10,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b ,c = map(int, input().split())
ans = []
n = 1
while True:
    m = n * a
    k = m - b

    if k > c:
        break
    else:
        if k <= 0:
            if m == c:
                ans.append(n)
        else:
            if k == c:
                ans.append(n)
    n += 1

if len(ans) == 0:
    print(-1)
else:
    print(*ans, sep='\n')
0