結果
問題 | No.312 置換処理 |
ユーザー |
![]() |
提出日時 | 2018-08-03 14:32:09 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 13 ms / 2,000 ms |
コード長 | 435 bytes |
コンパイル時間 | 2,270 ms |
コンパイル使用メモリ | 165,068 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-15 12:21:41 |
合計ジャッジ時間 | 3,817 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 45 |
ソースコード
#include<bits/stdc++.h>using namespace std;using Int = long long;template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}//INSERT ABOVE HEREsigned main(){Int n;cin>>n;Int ans=n;for(Int i=1;i*i<=n;i++){if(n%i) continue;if(2<i) chmin(ans,i);if(2<n/i) chmin(ans,n/i);}cout<<ans<<endl;return 0;}