結果

問題 No.745 letinopia raoha
ユーザー kenji_shioyakenji_shioya
提出日時 2018-10-21 06:09:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 580 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 10,868 KB
実行使用メモリ 8,260 KB
最終ジャッジ日時 2023-08-12 05:35:04
合計ジャッジ時間 1,092 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,788 KB
testcase_01 AC 16 ms
8,144 KB
testcase_02 AC 15 ms
7,740 KB
testcase_03 AC 16 ms
7,844 KB
testcase_04 AC 15 ms
8,076 KB
testcase_05 AC 15 ms
7,836 KB
testcase_06 AC 16 ms
7,860 KB
testcase_07 AC 15 ms
7,924 KB
testcase_08 AC 15 ms
7,880 KB
testcase_09 AC 16 ms
8,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
a,b,c,d = map(int,input().split())
if d >= 10:
    print('Impossible')
    sys.exit()
ans,f,c=0,1,0
while b > 0:
    if b >= 100:
        ans+=50*f*100
        b-=100
        f*=2
    else:
        ans+=50*f*b
        c=b
        b=0
while a > 0:
    if c > 0:
        if a >= 100-c:
            ans+=100*f*(100-c)
            f*=2
            a-=(100-c)
            c=0
        else:
            ans+=100*f*a
            break
    elif a >= 100:
        ans+=100*f*100
        a-=100
        f*=2
    else:
        ans+=100*f*a
        a=0
print('Possible')
print(ans)
0