結果
| 問題 | No.1966 Median of Divisors |
| コンテスト | |
| ユーザー |
sotanishy
|
| 提出日時 | 2022-06-03 21:49:53 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 215 ms / 2,000 ms |
| + 405µs | |
| コード長 | 278 bytes |
| 記録 | |
| コンパイル時間 | 234 ms |
| コンパイル使用メモリ | 96,200 KB |
| 実行使用メモリ | 84,940 KB |
| 最終ジャッジ日時 | 2026-09-01 09:20:21 |
| 合計ジャッジ時間 | 3,967 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 12 |
ソースコード
import sys
input = sys.stdin.readline
mod = 10**9+7
T = int(input())
for _ in range(T):
N, M = map(int, input().split())
x = pow(N, M, mod)
ans = x*(x+1)*pow(2, mod-2, mod)
y = pow(N, M//2, mod)
ans -= y*(y+1)*(2*y+1)*pow(6, mod-2, mod)
print(ans % mod)
sotanishy