結果

問題 No.312 置換処理
ユーザー sugim48
提出日時 2015-12-05 00:02:53
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 868 bytes
コンパイル時間 1,309 ms
コンパイル使用メモリ 79,268 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-15 11:41:58
合計ジャッジ時間 2,623 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 45
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
	ll N; cin >> N;
	for (ll i = 3; i * i <= N; i++)
		if (N % i == 0) {
			cout << i << endl;
			return 0;
		}
	if (N % 2 == 0 && N != 2 && N != 4) cout << N / 2 << endl;
	else cout << N << endl;
}
0