結果

問題 No.312 置換処理
ユーザー fal_rnd
提出日時 2016-10-29 16:37:44
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 392 bytes
コンパイル時間 1,928 ms
コンパイル使用メモリ 74,056 KB
実行使用メモリ 56,184 KB
最終ジャッジ日時 2024-11-24 18:02:39
合計ジャッジ時間 8,393 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
class A {
	static Scanner s = new Scanner(System.in);

	public static void main(String[] args) {
		long in = s.nextLong();
		if(in%3==0)
			System.out.println(3);
		if(in%4==0)
			System.out.println(4);
		long l = (long)(Math.sqrt(in)+0.6);
		long c = 5;
		while(in%c!=0){
			c+=2;
			if(c>l){
				System.out.println(in);
				return;
			}
		}
		System.out.println(c);
	}
}
0