結果
問題 |
No.276 連続する整数の和(1)
|
ユーザー |
![]() |
提出日時 | 2015-10-02 16:33:02 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 335 bytes |
コンパイル時間 | 557 ms |
コンパイル使用メモリ | 55,328 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-07-19 19:07:36 |
合計ジャッジ時間 | 4,634 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 TLE * 1 -- * 4 |
ソースコード
#include <iostream> using namespace std; int main() { long long n; cin>>n; auto a=n*(n+1)/2; auto b=(n+1)*(n+2)/2-1; auto res=1LL; for(auto i=1LL;i*i<=a;++i) { if (a%i==0) { if (b%i==0) res=max(res, i); if (b%(a/i)==0) res=max(res, a/i); } } cout<<res<<endl; }