結果
問題 |
No.1844 Divisors Sum Sum
|
ユーザー |
![]() |
提出日時 | 2022-02-18 22:56:02 |
言語 | D (dmd 2.109.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 589 bytes |
コンパイル時間 | 2,396 ms |
コンパイル使用メモリ | 207,240 KB |
実行使用メモリ | 16,328 KB |
最終ジャッジ日時 | 2024-06-22 14:21:25 |
合計ジャッジ時間 | 10,962 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | TLE * 1 -- * 37 |
ソースコード
import std; void main() { int L; readf("%d\n", L); ulong M = 10 ^^ 9 + 7; ulong res = 1; foreach (_; 0 .. L) { ulong P, e; readf("%d %d\n", P, e); if (res == 0) continue; ulong inv = powmod(P-1, M-2, M); ulong num = powmod(P, e+2, M); if (num < P) num += M; num -= P; num *= inv; if (num < e + 1) num += M; num -= e + 1; if (num > M) num %= M; num *= inv; if (num > M) num %= M; res *= num; if (res > M) res %= M; } res.writeln; }