結果

問題 No.333 門松列を数え上げ
ユーザー mitsuomitsuo
提出日時 2016-05-04 13:58:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 144 ms / 2,000 ms
コード長 561 bytes
コンパイル時間 2,252 ms
コンパイル使用メモリ 74,552 KB
実行使用メモリ 42,024 KB
最終ジャッジ日時 2024-04-15 11:17:25
合計ジャッジ時間 4,202 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 140 ms
41,676 KB
testcase_01 AC 144 ms
41,688 KB
testcase_02 AC 141 ms
41,444 KB
testcase_03 AC 140 ms
41,640 KB
testcase_04 AC 143 ms
41,568 KB
testcase_05 AC 140 ms
41,804 KB
testcase_06 AC 134 ms
41,460 KB
testcase_07 AC 136 ms
41,756 KB
testcase_08 AC 137 ms
42,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] input = new String[1];
		int i = 0;
		while (sc.hasNext()) {
			input[i] = sc.nextLine();
			i++;
		}

		System.out.println(solve(input));

		sc.close();
	}

	public static long solve(String[] in) {
		long a = Long.valueOf(in[0].split(" ")[0]);
		long b = Long.valueOf(in[0].split(" ")[1]);
		if (b > a) {
			// b > a > c || b > c > a;
			return b - 2L;
		} else {
			// a > c > b
			return 2000000000L - b - 1L;
		}
	}
}
0