結果
問題 | No.312 置換処理 |
ユーザー |
|
提出日時 | 2019-08-12 19:07:47 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 12 ms / 2,000 ms |
コード長 | 300 bytes |
コンパイル時間 | 1,766 ms |
コンパイル使用メモリ | 192,792 KB |
最終ジャッジ日時 | 2025-01-07 11:47:09 |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 45 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long ll;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>2) cout<<n/2<<endl;else cout<<n<<endl;return 0;}