結果

問題 No.745 letinopia raoha
ユーザー YamaKasa
提出日時 2019-02-10 20:58:41
言語 Java
(openjdk 23)
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 593 bytes
コンパイル時間 2,155 ms
コンパイル使用メモリ 74,224 KB
実行使用メモリ 41,668 KB
最終ジャッジ日時 2024-07-07 05:17:09
合計ジャッジ時間 4,337 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

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