結果

問題 No.1287 えぬけー
ユーザー chineristAC
提出日時 2020-10-01 09:04:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 237 ms / 2,000 ms
コード長 270 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 82,584 KB
実行使用メモリ 76,020 KB
最終ジャッジ日時 2024-07-07 01:20:43
合計ジャッジ時間 2,293 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

input = sys.stdin.readline

mod = 10**9+7

t = int(input())

assert(1<=t<=10**5)

for _ in range(t):
    x,k = map(int,input().split())

    assert(0<=x<mod)
    assert(1<=k<=5*10**8)
    assert(k%2==1)

    q = pow(k,5*10**8+1,mod-1)
    print(pow(x,q,mod))
0