結果

問題 No.825 賢いお買い物
ユーザー shinwisteriashinwisteria
提出日時 2019-08-30 16:27:24
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 660 bytes
コンパイル時間 3,651 ms
コンパイル使用メモリ 74,572 KB
実行使用メモリ 41,728 KB
最終ジャッジ日時 2024-05-01 09:21:49
合計ジャッジ時間 7,442 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
41,728 KB
testcase_01 AC 102 ms
41,676 KB
testcase_02 AC 102 ms
41,560 KB
testcase_03 AC 111 ms
41,420 KB
testcase_04 AC 110 ms
41,696 KB
testcase_05 WA -
testcase_06 AC 114 ms
41,604 KB
testcase_07 AC 115 ms
41,432 KB
testcase_08 AC 116 ms
41,412 KB
testcase_09 AC 102 ms
41,468 KB
testcase_10 AC 101 ms
41,308 KB
testcase_11 AC 115 ms
41,512 KB
testcase_12 AC 114 ms
39,984 KB
testcase_13 AC 114 ms
41,240 KB
testcase_14 AC 106 ms
41,336 KB
testcase_15 AC 111 ms
41,572 KB
testcase_16 AC 110 ms
41,312 KB
testcase_17 AC 114 ms
41,472 KB
testcase_18 AC 122 ms
41,284 KB
testcase_19 AC 104 ms
41,252 KB
testcase_20 AC 120 ms
40,004 KB
testcase_21 AC 105 ms
41,508 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package con_level_1half;
import java.util.Scanner;
public class Con825 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int a = s.nextInt() , b = s.nextInt() , c = s.nextInt();
		s.close();

		if(c >= a + b){
			System.out.println("Impossible");
		}else{
			int d = a + b - c;
			if(d < 10){
				if(d <= a){
					System.out.println(d);
				}else{
					System.out.println(a + (d - a) * 10);
				}
			}else{
				if(a > d){
					System.out.println((d + 1) % 10);
				}else{
					if(a > 10){
						System.out.println(a % 10 + (d - a + 1) * 10);
					}else{
						System.out.println(a + (d - a) * 10);
					}
				}
			}
		}
	}

}
0