結果

問題 No.745 letinopia raoha
ユーザー hhgfhn1
提出日時 2018-10-20 00:07:26
言語 Java
(openjdk 23)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 694 bytes
コンパイル時間 2,426 ms
コンパイル使用メモリ 74,612 KB
実行使用メモリ 41,824 KB
最終ジャッジ日時 2024-11-18 23:19:34
合計ジャッジ時間 4,658 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

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 n=0;
		int cnt=1;
		int bo=1;
		while(b>0){
			b--;
			sc+=50*bo;
			if(cnt==100){
				n++;
				bo=(int) Math.pow(2, n);
				cnt=0;
			}
			cnt++;
		}
		while(a>0){
			a--;
			sc+=100*bo;
			if(cnt==100){
				n++;
				bo=(int) Math.pow(2, n);
				cnt=0;
			}
			cnt++;
		}
		if(d>=10){
			System.out.println("Impossible");
		}else{
			System.out.println("Possible");
			System.out.println(sc);
		}
	}
}
0