結果

問題 No.745 letinopia raoha
ユーザー hhgfhn1
提出日時 2018-10-19 22:21:25
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 774 bytes
コンパイル時間 2,381 ms
コンパイル使用メモリ 77,444 KB
実行使用メモリ 41,932 KB
最終ジャッジ日時 2024-11-18 21:12:44
合計ジャッジ時間 3,978 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 2 WA * 6
権限があれば一括ダウンロードができます

ソースコード

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