結果

問題 No.745 letinopia raoha
ユーザー hhgfhn1hhgfhn1
提出日時 2018-10-20 00:07:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 694 bytes
コンパイル時間 4,052 ms
コンパイル使用メモリ 72,476 KB
実行使用メモリ 56,128 KB
最終ジャッジ日時 2023-08-12 03:00:05
合計ジャッジ時間 4,465 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,596 KB
testcase_01 AC 123 ms
55,980 KB
testcase_02 AC 122 ms
55,848 KB
testcase_03 AC 123 ms
55,564 KB
testcase_04 AC 120 ms
56,128 KB
testcase_05 AC 120 ms
55,852 KB
testcase_06 AC 121 ms
55,692 KB
testcase_07 AC 118 ms
55,456 KB
testcase_08 AC 118 ms
55,604 KB
testcase_09 AC 121 ms
55,964 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 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