結果
問題 |
No.414 衝動
|
ユーザー |
![]() |
提出日時 | 2016-10-20 06:28:15 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 812 bytes |
コンパイル時間 | 1,338 ms |
コンパイル使用メモリ | 161,448 KB |
実行使用メモリ | 564,268 KB |
最終ジャッジ日時 | 2024-11-23 14:33:26 |
合計ジャッジ時間 | 6,243 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 RE * 6 TLE * 1 MLE * 1 |
ソースコード
#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) { 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; } std::vector<bool> flg(M + 1, true); for (int i = 3; i*i <= M; i += 2) { if (flg[i]) { if (M%i == 0) { std::cout << i << " " << M / i << std::endl; return 0; } for (int j = 2; j*i <= M; j++) { flg[j*i] = false; } } } }