結果

問題 No.1258 コインゲーム
ユーザー ayaoniayaoni
提出日時 2020-10-27 12:48:46
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 295 ms / 2,000 ms
コード長 286 bytes
コンパイル時間 726 ms
コンパイル使用メモリ 86,660 KB
実行使用メモリ 77,904 KB
最終ジャッジ日時 2023-09-29 03:15:15
合計ジャッジ時間 18,884 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
77,520 KB
testcase_01 AC 142 ms
77,708 KB
testcase_02 AC 110 ms
76,876 KB
testcase_03 AC 248 ms
77,604 KB
testcase_04 AC 273 ms
77,396 KB
testcase_05 AC 122 ms
77,492 KB
testcase_06 AC 224 ms
77,540 KB
testcase_07 AC 108 ms
76,648 KB
testcase_08 AC 111 ms
76,824 KB
testcase_09 AC 163 ms
77,384 KB
testcase_10 AC 248 ms
77,400 KB
testcase_11 AC 272 ms
77,744 KB
testcase_12 AC 220 ms
77,736 KB
testcase_13 AC 136 ms
77,520 KB
testcase_14 AC 109 ms
76,940 KB
testcase_15 AC 243 ms
77,520 KB
testcase_16 AC 126 ms
77,380 KB
testcase_17 AC 263 ms
77,492 KB
testcase_18 AC 156 ms
77,592 KB
testcase_19 AC 153 ms
77,596 KB
testcase_20 AC 222 ms
77,712 KB
testcase_21 AC 256 ms
77,592 KB
testcase_22 AC 207 ms
77,580 KB
testcase_23 AC 182 ms
77,596 KB
testcase_24 AC 128 ms
77,564 KB
testcase_25 AC 173 ms
77,480 KB
testcase_26 AC 160 ms
77,788 KB
testcase_27 AC 254 ms
77,640 KB
testcase_28 AC 142 ms
77,484 KB
testcase_29 AC 141 ms
77,236 KB
testcase_30 AC 295 ms
77,412 KB
testcase_31 AC 147 ms
77,356 KB
testcase_32 AC 119 ms
77,604 KB
testcase_33 AC 227 ms
77,644 KB
testcase_34 AC 266 ms
77,664 KB
testcase_35 AC 153 ms
77,576 KB
testcase_36 AC 254 ms
77,600 KB
testcase_37 AC 159 ms
77,592 KB
testcase_38 AC 250 ms
77,380 KB
testcase_39 AC 141 ms
77,324 KB
testcase_40 AC 278 ms
77,664 KB
testcase_41 AC 282 ms
77,544 KB
testcase_42 AC 283 ms
77,904 KB
testcase_43 AC 283 ms
77,496 KB
testcase_44 AC 284 ms
77,592 KB
testcase_45 AC 284 ms
77,684 KB
testcase_46 AC 282 ms
77,668 KB
testcase_47 AC 288 ms
77,616 KB
testcase_48 AC 285 ms
77,704 KB
testcase_49 AC 280 ms
77,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())


S = I()
mod = 10**9+7
for _ in range(S):
    N,M,X = MI()
    ans = pow(1+M,N,mod)+(1-2*X)*pow(1-M,N,mod)
    ans *= (mod+1)//2
    ans %= mod
    print(ans)
0