結果

問題 No.1287 えぬけー
ユーザー H3PO4H3PO4
提出日時 2022-08-14 10:28:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 662 ms / 2,000 ms
コード長 256 bytes
コンパイル時間 123 ms
コンパイル使用メモリ 11,844 KB
実行使用メモリ 10,228 KB
最終ジャッジ日時 2023-10-26 03:24:32
合計ジャッジ時間 4,734 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,048 KB
testcase_01 AC 29 ms
10,048 KB
testcase_02 AC 28 ms
10,048 KB
testcase_03 AC 29 ms
10,048 KB
testcase_04 AC 29 ms
9,984 KB
testcase_05 AC 643 ms
10,228 KB
testcase_06 AC 648 ms
10,228 KB
testcase_07 AC 662 ms
10,228 KB
testcase_08 AC 612 ms
10,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

input = sys.stdin.buffer.readline

MOD = 10 ** 9 + 7


def solve(X, K):
    assert K not in (2, 500000003)
    L = pow(K, -1, MOD - 1)
    return pow(X, L, MOD)


T = int(input())
for _ in range(T):
    print(solve(*map(int, input().split())))
0