結果

問題 No.72 そろばん Med
ユーザー kpinkcat
提出日時 2023-10-14 20:55:41
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 419 bytes
コンパイル時間 853 ms
コンパイル使用メモリ 102,260 KB
最終ジャッジ日時 2025-02-17 07:49:43
ジャッジサーバーID
(参考情報)
judge4 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include<list>
#include<queue>
#include<math.h>
#include<bitset>
using ll = long long;
using namespace std;

int main(){
    ll n, n1, n2, ans, mod = 1e6+7;
    cin >> n;
    (!(n % 2)) ? (n1 = n/2) : (n1 = n/2 + 1);
    n1 %= mod;
    n2 = n - n1;
    n2 %= mod;
    cout << ((n2 + 1)*(n1 + 1)-1)%mod << endl;
}

0