結果
問題 | No.1844 Divisors Sum Sum |
ユーザー |
![]() |
提出日時 | 2021-12-14 22:59:14 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 109 ms / 3,000 ms |
コード長 | 515 bytes |
コンパイル時間 | 3,005 ms |
コンパイル使用メモリ | 245,892 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-23 19:41:50 |
合計ジャッジ時間 | 7,670 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 38 |
ソースコード
#include <bits/stdc++.h>#include <atcoder/modint>using namespace std;using Modint = atcoder::modint1000000007;int main(){cin.tie(nullptr);ios::sync_with_stdio(false);int L;cin >> L;Modint ans = 1;while(L--){int p, e;cin >> p >> e;const Modint P = Modint::raw(p), inv = (--Modint(P)).inv();Modint c = P.pow(e + 2) - P;c *= inv;c -= Modint::raw(e + 1);c *= inv;ans *= c;}cout << ans.val() << endl;}