結果

問題 No.825 賢いお買い物
ユーザー URechaRechaURechaRecha
提出日時 2019-09-03 09:27:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 555 bytes
コンパイル時間 113 ms
コンパイル使用メモリ 10,924 KB
実行使用メモリ 7,916 KB
最終ジャッジ日時 2023-08-24 22:47:46
合計ジャッジ時間 2,149 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,816 KB
testcase_01 AC 16 ms
7,780 KB
testcase_02 AC 16 ms
7,756 KB
testcase_03 AC 15 ms
7,796 KB
testcase_04 AC 16 ms
7,768 KB
testcase_05 WA -
testcase_06 AC 15 ms
7,828 KB
testcase_07 AC 16 ms
7,856 KB
testcase_08 AC 16 ms
7,820 KB
testcase_09 AC 16 ms
7,800 KB
testcase_10 AC 16 ms
7,768 KB
testcase_11 AC 16 ms
7,772 KB
testcase_12 AC 16 ms
7,832 KB
testcase_13 AC 16 ms
7,916 KB
testcase_14 WA -
testcase_15 AC 15 ms
7,788 KB
testcase_16 AC 16 ms
7,760 KB
testcase_17 AC 15 ms
7,884 KB
testcase_18 AC 15 ms
7,792 KB
testcase_19 AC 15 ms
7,700 KB
testcase_20 AC 16 ms
7,792 KB
testcase_21 AC 15 ms
7,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def func(n1:int,n10:int,r:int):
    a,b =n1,n10
    if n1 + n10 <= r:
        return "Impossible"
    else:
        p1,p10 =0,0
        while n1+n10-r >0:
            if n1>0:
                n1 -= 1
                p1 += 1
            else:
                if n10>0:
                    n10 -= 1
                    p10 += 1
    #釣りを受け取れる場合
    while n1 > 1 and p1 > 10:
        n1 -=1
        p1 +=1
        p1 -=10
        n10 +=1
    ans = a+b*10 - (n1 + n10 *10)
    return ans

a,b,c = map(int,input().split())
print(func(a,b,c))
0