結果

問題 No.745 letinopia raoha
ユーザー hhgfhn1hhgfhn1
提出日時 2018-10-19 22:21:25
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 774 bytes
コンパイル時間 2,688 ms
コンパイル使用メモリ 76,900 KB
実行使用メモリ 41,592 KB
最終ジャッジ日時 2024-04-29 16:10:36
合計ジャッジ時間 4,255 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 114 ms
41,176 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 112 ms
39,884 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 100 ms
41,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int a=scanner.nextInt();
		int b=scanner.nextInt();
		int c=scanner.nextInt();
		int d=scanner.nextInt();
		int sc=0;
		int life=1000;
		int n=0;
		int bo=1;
		while(a>=100){
			a-=100;
			sc+=100*100*bo;
			n++;
			bo=(int) Math.pow(2, n);
		}
		sc+=a*100*bo;
		
		if(b>=100-a){
			b-=(100-a);
			sc+=(100-a)*50*bo;
			n++;
			bo=(int) Math.pow(2, n);
		}
		
		while(b>=100){
			b-=100;
			sc+=100*50*bo;
			n++;
			bo=(int) Math.pow(2, n);
		}
		sc+=b*50*bo;
		sc-=d*100;
		
		if(d>=10){
			System.out.println("Impossible");
		}else{
			System.out.println("Possible");
			System.out.println(sc);
		}
	}
}
0