結果

問題 No.1253 雀見椪
ユーザー 👑 KazunKazun
提出日時 2020-07-12 16:02:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 240 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 79,148 KB
最終ジャッジ日時 2023-09-18 07:10:32
合計ジャッジ時間 4,098 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,176 KB
testcase_01 AC 75 ms
71,084 KB
testcase_02 AC 77 ms
71,176 KB
testcase_03 AC 101 ms
75,732 KB
testcase_04 AC 237 ms
78,860 KB
testcase_05 AC 237 ms
79,148 KB
testcase_06 AC 240 ms
78,984 KB
testcase_07 AC 237 ms
78,808 KB
testcase_08 AC 239 ms
78,624 KB
testcase_09 AC 236 ms
78,888 KB
testcase_10 AC 238 ms
78,976 KB
testcase_11 AC 239 ms
78,940 KB
testcase_12 AC 236 ms
78,724 KB
testcase_13 AC 238 ms
78,648 KB
testcase_14 AC 76 ms
71,232 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(A+B,N,M)+pow(B+C,N,M)+pow(C+A,N,M)
    Y=pow(A,N,M)+pow(B,N,M)+pow(C,N,M)
    H.append((1-X+2*Y)%M)

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