結果

問題 No.1253 雀見椪
ユーザー convexineqconvexineq
提出日時 2020-12-21 22:01:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 234 ms / 2,000 ms
コード長 327 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 81,624 KB
実行使用メモリ 76,572 KB
最終ジャッジ日時 2023-10-21 11:52:03
合計ジャッジ時間 4,360 ms
ジャッジサーバーID
(参考情報)
judge11 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,264 KB
testcase_01 AC 37 ms
53,264 KB
testcase_02 AC 40 ms
53,264 KB
testcase_03 AC 72 ms
67,740 KB
testcase_04 AC 233 ms
76,560 KB
testcase_05 AC 228 ms
76,556 KB
testcase_06 AC 228 ms
76,564 KB
testcase_07 AC 229 ms
76,564 KB
testcase_08 AC 228 ms
76,560 KB
testcase_09 AC 228 ms
76,548 KB
testcase_10 AC 227 ms
76,568 KB
testcase_11 AC 229 ms
76,572 KB
testcase_12 AC 229 ms
76,568 KB
testcase_13 AC 234 ms
76,560 KB
testcase_14 AC 39 ms
53,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10**9+7
T = int(input())
for _ in range(T):
    n,g1,g2,c1,c2,p1,p2 = map(int,input().split())
    g = g1*pow(g2,MOD-2,MOD)
    c = c1*pow(c2,MOD-2,MOD)
    p = p1*pow(p2,MOD-2,MOD)
    res = pow(g+c,n,MOD) + pow(c+p,n,MOD) + pow(p+g,n,MOD)
    res -= 2*(pow(g,n,MOD) + pow(c,n,MOD) + pow(p,n,MOD))
    print((1-res)%MOD)
0