結果

問題 No.395 永遠の17歳
ユーザー Pump0129Pump0129
提出日時 2018-03-26 22:36:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 1,000 ms
コード長 636 bytes
コンパイル時間 2,103 ms
コンパイル使用メモリ 72,084 KB
実行使用メモリ 56,168 KB
最終ジャッジ日時 2023-09-07 18:28:46
合計ジャッジ時間 5,017 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
56,164 KB
testcase_01 AC 117 ms
55,764 KB
testcase_02 AC 119 ms
56,024 KB
testcase_03 AC 119 ms
56,068 KB
testcase_04 AC 117 ms
55,768 KB
testcase_05 AC 116 ms
55,608 KB
testcase_06 AC 116 ms
56,080 KB
testcase_07 AC 118 ms
55,840 KB
testcase_08 AC 118 ms
55,528 KB
testcase_09 AC 120 ms
55,580 KB
testcase_10 AC 118 ms
55,940 KB
testcase_11 AC 117 ms
55,384 KB
testcase_12 AC 118 ms
55,916 KB
testcase_13 AC 117 ms
56,168 KB
testcase_14 AC 119 ms
55,824 KB
testcase_15 AC 118 ms
55,900 KB
testcase_16 AC 118 ms
55,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package net.ipipip0129.yukicoder.no395;

import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        int arg = Integer.parseInt(scan.nextLine());
        int fake_arg = -1;

        // 14歳以下は17歳を名乗れない(17歳を名乗れる最低進数は8のため
        if (15 <= arg) {
            // 実年齢から7(7は17の7を名乗るのに必要)を引くことで1の部分(繰り上がりに必要な数)が手に入る。
            fake_arg = arg - 7;
        }

        System.out.println(fake_arg);
    }
}
0