結果

問題 No.1422 Social Distance in Train
ユーザー ks2mks2m
提出日時 2021-03-12 21:23:21
言語 Java21
(openjdk 21)
結果
AC  
実行時間 149 ms / 2,000 ms
コード長 284 bytes
コンパイル時間 2,629 ms
コンパイル使用メモリ 75,412 KB
実行使用メモリ 56,184 KB
最終ジャッジ日時 2024-04-22 12:00:57
合計ジャッジ時間 5,375 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
54,160 KB
testcase_01 AC 140 ms
54,212 KB
testcase_02 AC 143 ms
54,572 KB
testcase_03 AC 139 ms
54,200 KB
testcase_04 AC 138 ms
54,216 KB
testcase_05 AC 142 ms
54,084 KB
testcase_06 AC 149 ms
54,072 KB
testcase_07 AC 138 ms
54,060 KB
testcase_08 AC 141 ms
54,296 KB
testcase_09 AC 145 ms
54,288 KB
testcase_10 AC 142 ms
54,040 KB
testcase_11 AC 145 ms
53,996 KB
testcase_12 AC 142 ms
56,184 KB
testcase_13 AC 141 ms
54,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();

		if (n % 2 == 1) {
			System.out.println(1);
		} else {
			System.out.println(n / 2 + 1);
		}
	}
}
0