結果

問題 No.192 合成数
ユーザー haruki_57haruki_57
提出日時 2015-05-04 01:34:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 440 bytes
コンパイル時間 2,132 ms
コンパイル使用メモリ 71,284 KB
実行使用メモリ 56,552 KB
最終ジャッジ日時 2023-09-09 08:27:28
合計ジャッジ時間 6,482 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
56,120 KB
testcase_01 AC 114 ms
55,836 KB
testcase_02 AC 112 ms
55,664 KB
testcase_03 AC 112 ms
56,304 KB
testcase_04 AC 114 ms
55,544 KB
testcase_05 AC 112 ms
55,504 KB
testcase_06 AC 111 ms
55,892 KB
testcase_07 AC 117 ms
56,428 KB
testcase_08 AC 115 ms
56,552 KB
testcase_09 AC 112 ms
55,656 KB
testcase_10 AC 112 ms
55,716 KB
testcase_11 AC 111 ms
55,940 KB
testcase_12 AC 114 ms
55,972 KB
testcase_13 AC 111 ms
54,024 KB
testcase_14 AC 112 ms
55,676 KB
testcase_15 AC 111 ms
55,680 KB
testcase_16 AC 111 ms
56,072 KB
testcase_17 AC 112 ms
55,736 KB
testcase_18 AC 115 ms
56,008 KB
testcase_19 AC 112 ms
55,552 KB
testcase_20 AC 116 ms
56,012 KB
testcase_21 AC 114 ms
56,028 KB
testcase_22 AC 112 ms
55,628 KB
testcase_23 AC 112 ms
56,036 KB
testcase_24 AC 112 ms
56,056 KB
testcase_25 AC 111 ms
55,936 KB
testcase_26 AC 115 ms
55,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main {

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n = sc.nextInt();
        for (int i = Math.max(3, n-100); i <= n + 100; i++) {    
            for (int j = 2; j*j <= i; j++) {
                if(i%j==0){
                    System.out.println(i);
                    return;
                }
            }            
        }
    }

}
0