結果

問題 No.192 合成数
ユーザー 37zigen37zigen
提出日時 2016-03-31 12:27:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 319 bytes
コンパイル時間 2,792 ms
コンパイル使用メモリ 70,840 KB
実行使用メモリ 56,116 KB
最終ジャッジ日時 2023-09-09 08:50:15
合計ジャッジ時間 7,521 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,484 KB
testcase_01 AC 125 ms
55,328 KB
testcase_02 AC 123 ms
56,116 KB
testcase_03 AC 123 ms
55,428 KB
testcase_04 AC 124 ms
55,792 KB
testcase_05 AC 125 ms
55,868 KB
testcase_06 AC 121 ms
55,668 KB
testcase_07 AC 123 ms
55,640 KB
testcase_08 AC 118 ms
55,616 KB
testcase_09 AC 121 ms
56,032 KB
testcase_10 AC 121 ms
55,848 KB
testcase_11 AC 121 ms
55,380 KB
testcase_12 AC 123 ms
55,732 KB
testcase_13 AC 124 ms
55,748 KB
testcase_14 AC 124 ms
56,080 KB
testcase_15 AC 127 ms
55,696 KB
testcase_16 AC 123 ms
55,800 KB
testcase_17 AC 124 ms
55,700 KB
testcase_18 AC 128 ms
55,604 KB
testcase_19 AC 126 ms
55,720 KB
testcase_20 AC 124 ms
55,616 KB
testcase_21 AC 123 ms
55,600 KB
testcase_22 AC 123 ms
55,444 KB
testcase_23 AC 123 ms
55,708 KB
testcase_24 AC 123 ms
55,968 KB
testcase_25 AC 122 ms
55,884 KB
testcase_26 AC 121 ms
55,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder192;
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=-100;i<=100;i++){
			for(int j=2;j<=n+i;j++){
				if((n+i)%j==0&&(n+i)!=j){
					System.out.println(n+i);
					return;
				}
			}
		}
	}
}
0