結果
| 問題 |
No.1844 Divisors Sum Sum
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-02-18 22:46:35 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 130 ms / 3,000 ms |
| コード長 | 720 bytes |
| コンパイル時間 | 1,613 ms |
| コンパイル使用メモリ | 168,952 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-29 09:32:29 |
| 合計ジャッジ時間 | 4,932 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 38 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#ifdef _RUTHEN
#include "debug.hpp"
#else
#define show(...) true
#endif
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define ALL(x) begin(x), end(x)
template <class T> using V = vector<T>;
#include <atcoder/modint>
using namespace atcoder;
using mint = modint1000000007;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll L;
cin >> L;
mint ans = 1;
rep(i, L) {
ll P, e;
cin >> P >> e;
mint pi = P;
mint ret = 0;
ret += (pi.pow(e + 1) - 1) / (P - 1) * P;
ret -= (e + 1);
ret /= (P - 1);
ans *= ret;
}
cout << ans.val() << '\n';
return 0;
}