c030: VII. $電電^{的指數^{的指數}}$
Tags : Fermat's Little Theorem Math
Accepted rate : 11人/18人 ( 61% ) [非即時]
評分方式:
Tolerant

最近更新 : 2022-09-11 13:48

Content

給定 $x, y, z$ 

計算 $(x^{y^z}) \%(10^9+7)$

Input

第一行有一個數 $n$, $n ≤ 10^5$

接下來有 $n$ 行

每行有三個數 $x_i$ $y_i$ $z_i$, $x_i, y_i, z_i ≤ 10^9$

 

Output

 輸出 $(x^{y^z}) \%(10^9+7)$

以換行隔開

Sample Input #1
3
2 3 2
5 2006 1
5 2006 88
Sample Output #1
512
719269352
246590939
測資資訊:
記憶體限制: 64 MB
公開 測資點#0 (10%): 1.0s , <1M
公開 測資點#1 (10%): 1.0s , <1M
公開 測資點#2 (10%): 1.0s , <1M
公開 測資點#3 (10%): 1.0s , <10M
公開 測資點#4 (10%): 1.0s , <10M
公開 測資點#5 (10%): 1.0s , <10M
公開 測資點#6 (10%): 1.0s , <10M
公開 測資點#7 (10%): 1.0s , <10M
公開 測資點#8 (10%): 1.0s , <10M
公開 測資點#9 (10%): 1.0s , <10M
Hint :

10% 測資 $y≤1$

20% 測資 $z≤1$

其他無限制

Tags:
Fermat's Little Theorem Math
出處:
臺中一中電腦資訊研習社 [管理者:
Ching367436 (Ching367436)
]


ID User Problem Subject Hit Post Date
53
Ching367436 (Ching367436)
c030
題解
513 2021-01-30 07:31