結果

問題 No.2194 兄弟の掛け引き
ユーザー titiatitia
提出日時 2023-01-20 21:25:16
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 16 ms / 1,000 ms
コード長 336 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 10,768 KB
実行使用メモリ 8,004 KB
最終ジャッジ日時 2023-09-05 13:33:00
合計ジャッジ時間 1,062 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,812 KB
testcase_01 AC 15 ms
7,860 KB
testcase_02 AC 15 ms
7,996 KB
testcase_03 AC 15 ms
7,792 KB
testcase_04 AC 15 ms
7,992 KB
testcase_05 AC 15 ms
7,972 KB
testcase_06 AC 15 ms
7,800 KB
testcase_07 AC 15 ms
8,004 KB
testcase_08 AC 15 ms
7,824 KB
testcase_09 AC 15 ms
7,888 KB
testcase_10 AC 14 ms
7,856 KB
testcase_11 AC 14 ms
7,876 KB
testcase_12 AC 15 ms
7,800 KB
testcase_13 AC 15 ms
7,752 KB
testcase_14 AC 15 ms
7,840 KB
testcase_15 AC 15 ms
7,832 KB
testcase_16 AC 15 ms
7,808 KB
権限があれば一括ダウンロードができます

ソースコード

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:
    LANS.sort()
    for a in LANS:
        print(a)
0