結果
問題 | No.312 置換処理 |
ユーザー |
![]() |
提出日時 | 2018-07-03 23:43:05 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 13 ms / 2,000 ms |
コード長 | 666 bytes |
コンパイル時間 | 1,906 ms |
コンパイル使用メモリ | 174,176 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-15 12:21:36 |
合計ジャッジ時間 | 3,233 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 45 |
ソースコード
#include "bits/stdc++.h"using namespace std;typedef long long ll;#define int lltypedef pair<int,int> pii;#define rep(i,n) for(ll i=0;i<(ll)(n);i++)#define all(a) (a).begin(),(a).end()#define pb emplace_back#define INF (1e9+1)vector<ll> divisor(ll n){vector<ll> ret;for(int i=1;i<=sqrt(n);i++){if(n%i==0){ret.pb(i);if(i!=n/i)ret.pb(n/i);}}sort(all(ret));return ret;}signed main(){int n;cin>>n;vector<ll> res = divisor(n);assert(res.back()==n);for(auto elm:res){if(elm>2){cout<<elm<<endl;return 0;}}}