結果

問題 No.745 letinopia raoha
ユーザー YamaKasaYamaKasa
提出日時 2019-02-10 20:58:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 593 bytes
コンパイル時間 3,215 ms
コンパイル使用メモリ 71,408 KB
実行使用メモリ 55,940 KB
最終ジャッジ日時 2023-09-21 11:18:08
合計ジャッジ時間 5,207 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,724 KB
testcase_01 AC 116 ms
55,848 KB
testcase_02 AC 117 ms
55,720 KB
testcase_03 AC 117 ms
55,828 KB
testcase_04 AC 115 ms
55,728 KB
testcase_05 AC 117 ms
55,940 KB
testcase_06 AC 115 ms
55,828 KB
testcase_07 AC 119 ms
55,932 KB
testcase_08 AC 114 ms
55,940 KB
testcase_09 AC 118 ms
55,508 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.nextInt();
		int D = sc.nextInt();
		sc.close();
		if(D == 10) {
			System.out.println("Impossible");
			System.exit(0);
		}
		System.out.println("Possible");
		int c = 0;
		int k = 1;
		int s = 0;
		for(int i = 0; i < B; i++) {
			s += 50 * k;
			c++;
			k = (int)Math.pow(2,c / 100);
		}
		for(int i = 0; i < A; i++) {
			s += 100 * k;
			c++;
			k = (int)Math.pow(2,c / 100);
		}
		System.out.println(s);
	}
}
0