結果

問題 No.72 そろばん Med
ユーザー nemunemu
提出日時 2024-01-19 06:58:47
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 364 bytes
コンパイル時間 628 ms
コンパイル使用メモリ 118,016 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-28 03:19:45
合計ジャッジ時間 1,415 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 1 WA * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

// No.72 そろばん Med
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const int MOD = 1000007;

int main() {
    int N;
    cin >> N;
    ll res;
    if (N % 2) {
        res = (ll)(N + 1) / 2 * ((N  - 1) / 2 + 1) + (N - 1) / 2;
    } else {
        res = (ll)N / 2 * (N / 2 + 1) + N / 2;
    }
    cout << res % MOD << endl;
}
0