結果

問題 No.745 letinopia raoha
ユーザー santafe1006santafe1006
提出日時 2018-11-14 23:11:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 1,159 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 10,876 KB
実行使用メモリ 7,932 KB
最終ジャッジ日時 2023-08-26 01:13:19
合計ジャッジ時間 1,151 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,844 KB
testcase_01 AC 16 ms
7,772 KB
testcase_02 AC 15 ms
7,892 KB
testcase_03 AC 15 ms
7,808 KB
testcase_04 AC 16 ms
7,800 KB
testcase_05 AC 16 ms
7,804 KB
testcase_06 AC 15 ms
7,892 KB
testcase_07 AC 16 ms
7,932 KB
testcase_08 AC 15 ms
7,796 KB
testcase_09 AC 16 ms
7,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,c,d = map(int,input().split())
p = 0
ax = 0
if d >= 10 :
    print("Impossible")
else :
    if a + b <= 100 :
        p = 100*a + 50*b
    else :
        b1,b2 = divmod(b,100)
        if b2 > 0 :
            # ax + b2 = 100
            ax = 100 - b2
            if ax < a :
                a = a - ax
            else :
                ax = a
                a = 0
        
            
        a1,a2 = divmod(a,100) 
        
        #print(a1,a2,ax,b1,b2)
        #↑
        #ここまでは正しい
        
        for i in range(b1) :
            p += 50 * 100 * 2**i
            #print("i = {} p = {}".format(i,p))
            
        p += 50 * b2 * 2**b1
        #print("p2 = {}".format(p))
        p += 100 * ax * 2**b1
        #print("p3 = {}".format(p))
        
        #if b1 == 0 :
        if b2 == 0 :
            basen = 0
        else :
            basen = 1
        #print(b1+basen)
        for j in range(b1+basen,b1+basen+a1) :
            p += 100 * 100 * 2**j
            #print("j = {} p = {}".format(j,p))
        p += 100 * a2 * 2**(b1+basen+a1)
    print("Possible")
    print(p)
        
            
            
 
    
    
0