結果
| 問題 | 
                            No.72 そろばん Med
                             | 
                    
| コンテスト | |
| ユーザー | 
                             RCCW
                         | 
                    
| 提出日時 | 2017-02-18 14:39:28 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 272 bytes | 
| コンパイル時間 | 771 ms | 
| コンパイル使用メモリ | 54,360 KB | 
| 実行使用メモリ | 10,496 KB | 
| 最終ジャッジ日時 | 2024-12-30 04:05:25 | 
| 合計ジャッジ時間 | 146,084 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 WA * 1 | 
| other | AC * 1 TLE * 23 | 
ソースコード
#include <iostream>
#include <cstdio>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
int main(){
	long long n=0;
	cin>>n;
long long u=0;
long long ans=0;
for (int i = 0; i <= n; ++i) {
ans=max(ans,(i*(n-i+1)+n-i)%1000007);
}
cout<<ans<<endl;
	return 0;
}
            
            
            
        
            
RCCW