結果

問題 No.333 門松列を数え上げ
ユーザー matsuyoshi30matsuyoshi30
提出日時 2016-01-15 22:44:28
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 395 bytes
コンパイル時間 2,065 ms
コンパイル使用メモリ 74,672 KB
実行使用メモリ 57,608 KB
最終ジャッジ日時 2023-10-19 23:25:07
合計ジャッジ時間 3,898 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
57,408 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 128 ms
57,576 KB
testcase_08 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Test {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String str1 = in.next();
		String str2 = in.next();
		int A = Integer.parseInt(str1);
		int B = Integer.parseInt(str2);
		
		if(A > B) {
			int m = 2000000000 - A;
			int n = A - B + 1;
			System.out.println(m + n);
		}
		if(A < B) {
			System.out.println(A - 1);
		}
	}
}
0