結果

問題 No.745 letinopia raoha
ユーザー fal_rndfal_rnd
提出日時 2019-02-19 14:52:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 159 ms / 2,000 ms
コード長 410 bytes
コンパイル時間 2,334 ms
コンパイル使用メモリ 76,572 KB
実行使用メモリ 41,904 KB
最終ジャッジ日時 2024-04-20 07:14:13
合計ジャッジ時間 4,709 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 155 ms
41,468 KB
testcase_01 AC 139 ms
41,208 KB
testcase_02 AC 156 ms
41,808 KB
testcase_03 AC 159 ms
41,428 KB
testcase_04 AC 136 ms
41,384 KB
testcase_05 AC 157 ms
41,212 KB
testcase_06 AC 154 ms
41,776 KB
testcase_07 AC 159 ms
41,904 KB
testcase_08 AC 156 ms
41,404 KB
testcase_09 AC 146 ms
41,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main{
	public static void main(String[] $){
		var s = new Scanner(System.in);
		int a=s.nextInt(),b=s.nextInt(),c=s.nextInt(),d=s.nextInt();
		if(d>9){
			System.out.println("Impossible");
			return;
		}
		long r=0;
		for(long i=1;a+b>0;i*=2){
			int v=Math.min(100,b),w=Math.min(100-v,a);
			b-=v;
			a-=w;
			r+=i*(v*50+w*100);
		}
		System.out.println("Possible\n"+r);
	}
}
0