結果

問題 No.312 置換処理
ユーザー femto
提出日時 2016-08-19 01:17:26
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 449 bytes
コンパイル時間 801 ms
コンパイル使用メモリ 76,404 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-07 19:38:37
合計ジャッジ時間 2,341 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 44 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <iomanip>
using namespace std;
typedef long long ll;

ll f(ll n) {
	ll ret = n;
	for(ll i = 2; i * i <= n; i++) {
		if(n % i == 0) {
			if(i != 2) {
				ret = min(ret, i);
			}
			ret = min(ret, n / i);
		}
	}
	return ret;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	ll N;
	cin >> N;
	cout << f(N) << endl;
}
0