結果

問題 No.1253 雀見椪
ユーザー 👑 KazunKazun
提出日時 2020-07-12 17:00:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 241 ms / 2,000 ms
コード長 341 bytes
コンパイル時間 943 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 78,976 KB
最終ジャッジ日時 2023-09-18 07:10:22
合計ジャッジ時間 5,183 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,060 KB
testcase_01 AC 76 ms
70,996 KB
testcase_02 AC 79 ms
71,104 KB
testcase_03 AC 101 ms
75,744 KB
testcase_04 AC 241 ms
78,960 KB
testcase_05 AC 236 ms
78,712 KB
testcase_06 AC 238 ms
78,684 KB
testcase_07 AC 239 ms
78,976 KB
testcase_08 AC 239 ms
78,720 KB
testcase_09 AC 239 ms
78,712 KB
testcase_10 AC 239 ms
78,804 KB
testcase_11 AC 239 ms
78,716 KB
testcase_12 AC 239 ms
78,708 KB
testcase_13 AC 237 ms
78,840 KB
testcase_14 AC 75 ms
71,068 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

M=10**9+7
T=int(input())

H=[]
for _ in range(T):
    U=list(map(int,input().split()))

    N=U[0]
    A=(U[1]*pow(U[2],M-2,M))%M
    B=(U[3]*pow(U[4],M-2,M))%M
    C=(U[5]*pow(U[6],M-2,M))%M

    X=(pow(1-A,N,M)+pow(1-B,N,M)+pow(1-C,N,M))%M
    Y=(pow(A,N,M)+pow(B,N,M)+pow(C,N,M))%M
    H.append((1-X+2*Y)%M)

print("\n".join(map(str,H)))
0