結果
| 問題 | No.3532 Non-Fourth-Power Sets |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-06-03 00:03:56 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 976 bytes |
| 記録 | |
| コンパイル時間 | 310 ms |
| コンパイル使用メモリ | 84,736 KB |
| 実行使用メモリ | 275,404 KB |
| 最終ジャッジ日時 | 2026-06-03 00:04:40 |
| 合計ジャッジ時間 | 36,440 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 20 |
ソースコード
import sys, math
MOD = 10**9 + 7
def factorize(a):
es = []
p = 2
while p * p <= a:
if a % p == 0:
cnt = 0
while a % p == 0:
a //= p
cnt += 1
es.append(cnt)
p += 1 if p == 2 else 2
if a > 1:
es.append(1)
return es
def solve():
it = iter(sys.stdin.buffer.read().split())
t = int(next(it))
out = []
for _ in range(t):
a = int(next(it))
b = int(next(it))
es = factorize(a)
for i in range(len(es)):
es[i] *= b
k = len(es)
if k == 0:
ans = 1
elif k == 1:
ans = es[0] + 1
elif k == 2 and es[0] == 2 and es[1] == 1:
ans = 10
elif k == 2 and es[0] == 4 and es[1] == 2:
ans = 185
else:
ans = 0
out.append(str(ans % MOD))
sys.stdout.write('\n'.join(out))
if __name__ == '__main__':
solve()