結果
問題 | No.136 Yet Another GCD Problem |
ユーザー |
![]() |
提出日時 | 2018-09-22 16:21:53 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 437 bytes |
コンパイル時間 | 1,769 ms |
コンパイル使用メモリ | 165,384 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-18 09:00:09 |
合計ジャッジ時間 | 2,858 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 39 |
ソースコード
#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 HERE signed main(){ Int n,k; cin>>n>>k; Int ans=0; for(Int i=1;i<=n;i++){ if(n%i) continue; Int x=n/i; if(x<2) continue; chmax(ans,i); } cout<<ans<<endl; return 0; }