結果

問題 No.72 そろばん Med
ユーザー nanasilinanasili
提出日時 2014-11-19 23:27:27
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 590 bytes
コンパイル時間 659 ms
コンパイル使用メモリ 79,268 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-21 11:35:02
合計ジャッジ時間 1,544 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cctype>
#include <string>
#include <cstring>

using namespace std;

typedef long long ll;

#define MODN 1000007

int main() {
  ll n;
  cin >> n;
  
  if (n%2) {
    cout << ((n+1)/2-1+(((n+1)/2)%MODN)*(((n+1)/2)%MODN))%MODN << endl;
  }else {
    cout << (n/2+(((n/2+1))%MODN)*((n/2)%MODN))%MODN << endl;
  }

}
0