結果

問題 No.72 そろばん Med
ユーザー itezpace
提出日時 2016-08-06 07:46:24
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 302 bytes
コンパイル時間 478 ms
コンパイル使用メモリ 54,752 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-21 11:56:15
合計ジャッジ時間 1,200 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
typedef long long ll;
const int mod=1e6+7;
int main(){
  ll n,x,y,z,a,b,c;
  cin>>n;
  y=0;
  for(ll i=n/2; i<=n/2+1; ++i){
    a=(n-i)%mod;
    b=(i+1)%mod;
    c=i%mod;
    x=a*b+c;
    if(x>=y){
      y=x;
    }
  }
  z=y%mod;
  cout<<z<<endl;
  return 0;
}
0