結果

問題 No.414 衝動
ユーザー fjafjafjafjafjafja
提出日時 2017-09-03 15:17:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 173 ms / 1,000 ms
コード長 401 bytes
コンパイル時間 3,509 ms
コンパイル使用メモリ 76,324 KB
実行使用メモリ 55,308 KB
最終ジャッジ日時 2024-04-27 08:32:29
合計ジャッジ時間 6,427 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 162 ms
54,820 KB
testcase_01 AC 160 ms
54,740 KB
testcase_02 AC 157 ms
55,164 KB
testcase_03 AC 173 ms
54,896 KB
testcase_04 AC 154 ms
54,844 KB
testcase_05 AC 167 ms
54,996 KB
testcase_06 AC 165 ms
54,908 KB
testcase_07 AC 155 ms
55,128 KB
testcase_08 AC 164 ms
54,980 KB
testcase_09 AC 168 ms
55,308 KB
testcase_10 AC 153 ms
54,828 KB
testcase_11 AC 155 ms
54,720 KB
testcase_12 AC 156 ms
54,912 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class N414 {

	public static void main(String[] args)
	{
		Scanner sc=new Scanner(System.in);
		long M=sc.nextLong();
		int end=0;
		long ans1=1;
		long ans2=M;
		if(M%2==0){ans1=2;ans2=M/2;}
		else
		{
			for(int i=3;i<=(int)Math.sqrt((double)M);i+=2)
			{
				if(M%i==0){ans1=i;ans2=M/i;break;}
			}
		}
		System.out.println(ans1+" "+ans2);
	}
}
0