結果

問題 No.395 永遠の17歳
ユーザー htensaihtensai
提出日時 2019-12-10 14:34:08
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 1,000 ms
コード長 390 bytes
コンパイル時間 1,969 ms
コンパイル使用メモリ 72,536 KB
実行使用メモリ 56,320 KB
最終ジャッジ日時 2023-09-06 07:09:08
合計ジャッジ時間 5,283 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
56,188 KB
testcase_01 AC 123 ms
55,804 KB
testcase_02 AC 124 ms
56,320 KB
testcase_03 AC 122 ms
55,668 KB
testcase_04 AC 124 ms
56,076 KB
testcase_05 AC 125 ms
56,292 KB
testcase_06 AC 123 ms
55,900 KB
testcase_07 AC 122 ms
54,016 KB
testcase_08 AC 122 ms
56,016 KB
testcase_09 AC 123 ms
55,588 KB
testcase_10 AC 123 ms
55,652 KB
testcase_11 AC 121 ms
56,040 KB
testcase_12 AC 122 ms
55,900 KB
testcase_13 AC 120 ms
55,688 KB
testcase_14 AC 124 ms
55,996 KB
testcase_15 AC 122 ms
56,132 KB
testcase_16 AC 122 ms
56,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int idx = 8;
        while (idx + 7 <= n) {
            if (idx + 7 == n) {
                System.out.println(idx);
                return;
            }
            idx++;
        }
        System.out.println(-1);
  }
}
0