結果

問題 No.395 永遠の17歳
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-05-03 13:55:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 59 ms / 1,000 ms
コード長 553 bytes
コンパイル時間 2,398 ms
コンパイル使用メモリ 75,728 KB
実行使用メモリ 50,428 KB
最終ジャッジ日時 2024-04-15 09:46:02
合計ジャッジ時間 3,658 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
50,356 KB
testcase_01 AC 58 ms
50,356 KB
testcase_02 AC 57 ms
50,280 KB
testcase_03 AC 56 ms
49,904 KB
testcase_04 AC 57 ms
50,144 KB
testcase_05 AC 55 ms
50,376 KB
testcase_06 AC 56 ms
50,100 KB
testcase_07 AC 56 ms
50,300 KB
testcase_08 AC 57 ms
50,348 KB
testcase_09 AC 59 ms
50,160 KB
testcase_10 AC 56 ms
50,320 KB
testcase_11 AC 55 ms
49,976 KB
testcase_12 AC 57 ms
50,344 KB
testcase_13 AC 55 ms
50,036 KB
testcase_14 AC 57 ms
50,428 KB
testcase_15 AC 57 ms
50,320 KB
testcase_16 AC 54 ms
50,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import static java.lang.System.in;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        int A = Integer.parseInt(reader.readLine());
        int answer = -1;
        for (int i = 1; i <= A - 7; i++) {
            if (A % i == 7 && A / i == 1) {
                answer=i;
            }
        }
        System.out.println(answer);
    }

}
0