結果

問題 No.414 衝動
ユーザー dgd1724
提出日時 2016-10-20 06:46:57
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 7 ms / 1,000 ms
コード長 809 bytes
コンパイル時間 1,300 ms
コンパイル使用メモリ 157,916 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-15 09:11:26
合計ジャッジ時間 2,133 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

//const static double	de_PI	= 3.14159265358979323846;
//const static int	de_MOD	= 1000000007;
//const static int	de_MAX	= 999999999;
//const static int	de_MIN = -999999999;

int main(void) {

	//std::ifstream in("123.txt");	std::cin.rdbuf(in.rdbuf());

	unsigned long long M = 0;
	std::cin >> M;

	if (M % 2 == 0) {
		std::cout << "2 " << M / 2 << std::endl;
		return 0;
	}

	switch (M) {
	case 1:std::cout << "1 1" << std::endl; return 0;
	case 3:std::cout << "1 3" << std::endl; return 0;
	case 5:std::cout << "1 5" << std::endl; return 0;
	case 7:std::cout << "1 7" << std::endl; return 0;
	}

	for (unsigned long long i = 3; i*i <= M; i += 2) {
		if (M%i == 0) {
				std::cout << i << " " << M / i << std::endl;
				return 0;
		}
	}

	std::cout << 1 << " " << M << std::endl;
}

0