結果

問題 No.414 衝動
ユーザー kapokapo
提出日時 2016-08-26 22:44:03
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 1,186 bytes
コンパイル時間 577 ms
コンパイル使用メモリ 80,184 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-26 02:17:29
合計ジャッジ時間 2,546 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 3 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 RE -
testcase_04 AC 3 ms
6,944 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 3 ms
6,944 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 3 ms
6,944 KB
testcase_11 AC 3 ms
6,940 KB
testcase_12 AC 3 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996)
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <functional>
#include <sstream>
#include <cmath>
#include <set>
#include <map>
#include <stack>
using namespace std; 

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>=(b);i--)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()
#define len(x) ((int)(x).size())
#define tmax(a,b,c) max((a),max((b),(c)))
#define tmin(a,b,c) min((a),min((b),(c)))
#define debug(x) cerr << #x << " is " << x << endl;

typedef pair<int, int> Pii;
typedef map<int, int> Mii;
typedef vector<int> Vi;
typedef long long ll;
const int inf = 2e9;
const ll ll_inf = 1e17;
const int mod = 1e9 + 7;
const long double eps = 1e-10;

ll a[101010];

int main()
{
	ll n;
	cin >> n;

	rep(i,2,1001) {
		int j = i + i;
		while (j < 100001) {
			a[j]++;
			j += i;
		}
	}

	rep(i,2,n) {
		if (!a[i]) {
			//printf("%d ",i);
			if (n % i == 0) {
				cout << n/i << " " << i << endl;
				return 0;
			}
		}
	}

	cout << 1 << " " << n << endl;
	return 0;
}
0