結果
| 問題 | No.312 置換処理 |
| コンテスト | |
| ユーザー |
femto
|
| 提出日時 | 2016-08-19 01:17:26 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 449 bytes |
| 記録 | |
| コンパイル時間 | 347 ms |
| コンパイル使用メモリ | 93,328 KB |
| 実行使用メモリ | 9,956 KB |
| 最終ジャッジ日時 | 2026-09-20 19:59:22 |
| 合計ジャッジ時間 | 2,546 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge4_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 44 WA * 1 |
ソースコード
#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;
}
femto