結果

問題 No.312 置換処理
ユーザー mits58mits58
提出日時 2016-07-29 22:27:09
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 458 bytes
コンパイル時間 2,201 ms
コンパイル使用メモリ 73,716 KB
実行使用メモリ 41,704 KB
最終ジャッジ日時 2024-04-24 12:22:14
合計ジャッジ時間 9,725 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
40,204 KB
testcase_01 WA -
testcase_02 AC 146 ms
41,108 KB
testcase_03 WA -
testcase_04 AC 132 ms
40,972 KB
testcase_05 AC 135 ms
41,348 KB
testcase_06 AC 134 ms
41,088 KB
testcase_07 AC 148 ms
41,136 KB
testcase_08 AC 133 ms
41,368 KB
testcase_09 AC 130 ms
41,240 KB
testcase_10 AC 132 ms
41,280 KB
testcase_11 AC 136 ms
41,348 KB
testcase_12 AC 133 ms
41,356 KB
testcase_13 AC 131 ms
41,292 KB
testcase_14 AC 134 ms
41,164 KB
testcase_15 AC 130 ms
41,096 KB
testcase_16 AC 130 ms
41,296 KB
testcase_17 AC 133 ms
41,348 KB
testcase_18 AC 129 ms
41,100 KB
testcase_19 AC 132 ms
41,184 KB
testcase_20 AC 133 ms
41,396 KB
testcase_21 AC 135 ms
40,916 KB
testcase_22 AC 134 ms
41,260 KB
testcase_23 WA -
testcase_24 AC 133 ms
41,704 KB
testcase_25 WA -
testcase_26 AC 134 ms
41,612 KB
testcase_27 WA -
testcase_28 AC 131 ms
41,496 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 131 ms
41,592 KB
testcase_32 AC 134 ms
41,364 KB
testcase_33 AC 137 ms
41,100 KB
testcase_34 AC 136 ms
41,124 KB
testcase_35 AC 133 ms
41,324 KB
testcase_36 AC 131 ms
41,260 KB
testcase_37 AC 131 ms
41,460 KB
testcase_38 AC 132 ms
41,488 KB
testcase_39 AC 134 ms
41,332 KB
testcase_40 AC 125 ms
41,368 KB
testcase_41 AC 130 ms
41,152 KB
testcase_42 AC 128 ms
41,132 KB
testcase_43 AC 130 ms
41,168 KB
testcase_44 AC 133 ms
41,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main{
	static boolean isprime(long x){
		if(x==1) return false;
		for(long i=2;i*i<=x;i++) if(x%i==0) return false;
		return true;
	}
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			long n=sc.nextLong();
			if(isprime(n)) System.out.println(n);
			else{
				for(long i=3;i*i<=n;i++){
					if(n%i==0){
						System.out.println(i);
						break;
					}
				}
			}
		}
	}
}
0