結果

問題 No.414 衝動
ユーザー nCk_cvnCk_cv
提出日時 2016-08-27 21:35:39
言語 Java21
(openjdk 21)
結果
AC  
実行時間 150 ms / 1,000 ms
コード長 331 bytes
コンパイル時間 1,839 ms
コンパイル使用メモリ 76,032 KB
実行使用メモリ 55,148 KB
最終ジャッジ日時 2024-04-27 08:23:51
合計ジャッジ時間 4,415 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
54,800 KB
testcase_01 AC 140 ms
54,844 KB
testcase_02 AC 123 ms
54,652 KB
testcase_03 AC 150 ms
54,976 KB
testcase_04 AC 141 ms
55,148 KB
testcase_05 AC 146 ms
54,860 KB
testcase_06 AC 141 ms
55,060 KB
testcase_07 AC 137 ms
54,856 KB
testcase_08 AC 132 ms
54,704 KB
testcase_09 AC 145 ms
54,684 KB
testcase_10 AC 137 ms
54,840 KB
testcase_11 AC 136 ms
54,912 KB
testcase_12 AC 131 ms
54,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Main {
		public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			long M = sc.nextLong();
			long ans = 1;
			for(long i = 2; i*i <= M; i++) {
				if(M % i == 0) {
					ans = i;
					M /= i;
					break;
				}
			}
			System.out.println(ans + " " + M);
			
		}
		
}
0