結果

問題 No.1253 雀見椪
ユーザー tanon710tanon710
提出日時 2020-10-15 22:30:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 564 ms / 2,000 ms
コード長 401 bytes
コンパイル時間 2,167 ms
コンパイル使用メモリ 86,684 KB
実行使用メモリ 77,904 KB
最終ジャッジ日時 2023-09-28 01:26:19
合計ジャッジ時間 8,151 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,272 KB
testcase_01 AC 74 ms
71,244 KB
testcase_02 AC 78 ms
71,420 KB
testcase_03 AC 145 ms
76,568 KB
testcase_04 AC 555 ms
77,588 KB
testcase_05 AC 553 ms
77,856 KB
testcase_06 AC 547 ms
77,904 KB
testcase_07 AC 552 ms
77,684 KB
testcase_08 AC 557 ms
77,856 KB
testcase_09 AC 553 ms
77,832 KB
testcase_10 AC 556 ms
77,644 KB
testcase_11 AC 553 ms
77,596 KB
testcase_12 AC 564 ms
77,836 KB
testcase_13 AC 551 ms
77,860 KB
testcase_14 AC 75 ms
71,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod=10**9+7

t=int(input())
for _ in range(t):
    n,ag,bg,ac,bc,ap,bp=map(int,input().split())
    g=ag*bc*bp
    c=ac*bg*bp
    p=ap*bg*bc
    ans=(pow(g+c,n,mod)-pow(g,n,mod)-pow(c,n,mod))%mod+(pow(c+p,n,mod)-pow(c,n,mod)-pow(p,n,mod))%mod+(pow(p+g,n,mod)-pow(p,n,mod)-pow(g,n,mod))%mod
    ans%=mod
    ans*=pow(pow(bg*bc*bp,mod-2,mod),n,mod)
    ans%=mod
    ans=1-ans
    ans%=mod
    print(ans)
0