結果

問題 No.745 letinopia raoha
コンテスト
ユーザー hhgfhn1
提出日時 2018-10-20 00:07:26
言語 Java
(openjdk 26.0.2.1 + ACL)
コンパイル:
javac -J-Duser.language=en -encoding UTF8 -cp /opt/aclib/ac_library.jar _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true -cp .:/opt/aclib/ac_library.jar _class_
結果
AC  
実行時間 56 ms / 2,000 ms
+ 173µs
コード長 694 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,317 ms
コンパイル使用メモリ 85,700 KB
実行使用メモリ 45,320 KB
最終ジャッジ日時 2026-09-26 02:41:19
合計ジャッジ時間 3,603 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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