結果

問題 No.2194 兄弟の掛け引き
ユーザー titiatitia
提出日時 2023-01-20 21:24:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 320 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 10,768 KB
実行使用メモリ 8,024 KB
最終ジャッジ日時 2023-09-05 13:32:27
合計ジャッジ時間 1,383 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 15 ms
7,984 KB
testcase_02 AC 14 ms
7,868 KB
testcase_03 WA -
testcase_04 AC 16 ms
7,796 KB
testcase_05 AC 16 ms
7,860 KB
testcase_06 AC 15 ms
7,864 KB
testcase_07 AC 15 ms
7,884 KB
testcase_08 AC 15 ms
7,992 KB
testcase_09 WA -
testcase_10 AC 15 ms
7,920 KB
testcase_11 AC 15 ms
7,800 KB
testcase_12 AC 15 ms
7,884 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 15 ms
7,848 KB
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

A,B,C=map(int,input().split())

ANS=[]

if (C+B)%A==0:
    ANS.append((C+B)//A)
if C%A==0:
    ANS.append(C//A)


LANS=[]

for a in ANS:
    x=a*A
    if x-B>0:
        x-=B

    if x==C:
        LANS.append(a)

if LANS==[]:
    print(-1)
else:
    for a in LANS:
        print(a)
0