結果

問題 No.1844 Divisors Sum Sum
ユーザー hourenhouren
提出日時 2022-02-18 22:27:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 230 ms / 3,000 ms
コード長 793 bytes
コンパイル時間 1,700 ms
コンパイル使用メモリ 165,828 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-11 19:32:56
合計ジャッジ時間 6,745 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 224 ms
4,380 KB
testcase_01 AC 227 ms
4,384 KB
testcase_02 AC 227 ms
4,380 KB
testcase_03 AC 228 ms
4,380 KB
testcase_04 AC 230 ms
4,380 KB
testcase_05 AC 227 ms
4,384 KB
testcase_06 AC 227 ms
4,388 KB
testcase_07 AC 228 ms
4,380 KB
testcase_08 AC 227 ms
4,384 KB
testcase_09 AC 226 ms
4,384 KB
testcase_10 AC 208 ms
4,380 KB
testcase_11 AC 46 ms
4,380 KB
testcase_12 AC 158 ms
4,384 KB
testcase_13 AC 23 ms
4,384 KB
testcase_14 AC 75 ms
4,384 KB
testcase_15 AC 2 ms
4,384 KB
testcase_16 AC 2 ms
4,384 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 1 ms
4,384 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 1 ms
4,380 KB
testcase_23 AC 2 ms
4,384 KB
testcase_24 AC 2 ms
4,384 KB
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 1 ms
4,380 KB
testcase_27 AC 2 ms
4,384 KB
testcase_28 AC 1 ms
4,384 KB
testcase_29 AC 1 ms
4,384 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 1 ms
4,384 KB
testcase_32 AC 2 ms
4,380 KB
testcase_33 AC 1 ms
4,380 KB
testcase_34 AC 1 ms
4,380 KB
testcase_35 AC 2 ms
4,384 KB
testcase_36 AC 1 ms
4,380 KB
testcase_37 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()
template<class T>bool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool chmax(T&a, const T&b){if(a<b){a=b;return 1;}return 0;}
const ll MOD = 1000000007;
ll mpow(ll x, ll y){
    ll res = 1; x %= MOD;
    while(y){
        if(y%2) res = res * x % MOD;
        x = x * x % MOD;
        y /= 2;
    }
    return res;
}
int main(){
    ll l,ans = 1;
    cin >> l;
    rep(i,l){
        ll r,n;
        cin >> r >> n;
        n++;
        ll x = mpow(r-1, MOD-2);
        ans = ans * ((r * (mpow(r,n) - 1) % MOD * x % MOD - n + MOD) * x % MOD) % MOD;
    }
    cout << ans << endl;
    return 0;
}
0