結果

問題 No.1844 Divisors Sum Sum
ユーザー umezoumezo
提出日時 2022-02-18 23:19:24
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 143 ms / 3,000 ms
コード長 623 bytes
コンパイル時間 1,993 ms
コンパイル使用メモリ 200,752 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2023-09-11 20:07:19
合計ジャッジ時間 6,091 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
6,188 KB
testcase_01 AC 141 ms
6,228 KB
testcase_02 AC 141 ms
6,212 KB
testcase_03 AC 141 ms
6,228 KB
testcase_04 AC 142 ms
6,272 KB
testcase_05 AC 143 ms
6,164 KB
testcase_06 AC 141 ms
6,224 KB
testcase_07 AC 142 ms
6,168 KB
testcase_08 AC 143 ms
6,204 KB
testcase_09 AC 141 ms
6,192 KB
testcase_10 AC 129 ms
5,928 KB
testcase_11 AC 29 ms
4,380 KB
testcase_12 AC 100 ms
5,080 KB
testcase_13 AC 16 ms
4,380 KB
testcase_14 AC 48 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 1 ms
4,380 KB
testcase_28 AC 1 ms
4,376 KB
testcase_29 AC 2 ms
4,376 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 1 ms
4,380 KB
testcase_32 AC 2 ms
4,376 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 AC 1 ms
4,380 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 2 ms
4,376 KB
testcase_37 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;

#include <bits/stdc++.h>
using namespace std;

const int MOD=1e9+7;
ll modpow(ll x,ll n){
  ll ans=1;
  while(n){
    if(n&1) ans=ans*x%MOD;
    x=x*x%MOD;
    n/=2;
  }
  return ans;
}

ll f(ll p,ll e){
  return (p*(modpow(p,e+1)-1)%MOD*modpow(p-1,MOD-2)-e-1+MOD)%MOD*modpow(p-1,MOD-2)%MOD;
}
 
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  int L;
  cin>>L;
  vector<ll> P(L),e(L);
  rep(i,L) cin>>P[i]>>e[i];
  ll ans=1;
  rep(i,L) ans=ans*f(P[i],e[i])%MOD;
  cout<<ans<<endl;
  
  return 0;
}
0