結果

問題 No.192 合成数
ユーザー kou6839kou6839
提出日時 2015-04-26 22:07:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 338 bytes
コンパイル時間 2,443 ms
コンパイル使用メモリ 71,044 KB
実行使用メモリ 56,296 KB
最終ジャッジ日時 2023-09-09 08:18:38
合計ジャッジ時間 7,144 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
56,196 KB
testcase_01 AC 111 ms
56,208 KB
testcase_02 AC 110 ms
55,784 KB
testcase_03 AC 113 ms
55,896 KB
testcase_04 AC 111 ms
56,096 KB
testcase_05 AC 112 ms
55,720 KB
testcase_06 AC 118 ms
56,036 KB
testcase_07 AC 112 ms
55,820 KB
testcase_08 AC 112 ms
55,572 KB
testcase_09 AC 113 ms
55,988 KB
testcase_10 AC 112 ms
55,588 KB
testcase_11 AC 113 ms
55,936 KB
testcase_12 AC 113 ms
56,048 KB
testcase_13 AC 112 ms
55,964 KB
testcase_14 AC 112 ms
55,996 KB
testcase_15 AC 116 ms
55,840 KB
testcase_16 AC 112 ms
55,564 KB
testcase_17 AC 112 ms
55,816 KB
testcase_18 AC 112 ms
55,956 KB
testcase_19 AC 112 ms
56,108 KB
testcase_20 AC 114 ms
55,636 KB
testcase_21 AC 114 ms
56,296 KB
testcase_22 AC 112 ms
55,904 KB
testcase_23 AC 113 ms
55,428 KB
testcase_24 AC 115 ms
56,248 KB
testcase_25 AC 114 ms
56,096 KB
testcase_26 AC 113 ms
55,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main(String[] args){
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for(int i=n-100;i<=n+100;i++){
			for(int j=2;j*j<=i;j++){
				if(i%j==0){
					System.out.println(i);
					return;
				}
			}
		}
	}
}
0