結果

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

ソースコード

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);
			return;
		}
		if(in%4==0){
			System.out.println(4);
			return;
		}
		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