結果

問題 No.1258 コインゲーム
ユーザー yuusanlondonyuusanlondon
提出日時 2020-10-16 22:06:14
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 468 ms / 2,000 ms
コード長 224 bytes
コンパイル時間 1,799 ms
コンパイル使用メモリ 86,984 KB
実行使用メモリ 78,948 KB
最終ジャッジ日時 2023-09-28 03:12:03
合計ジャッジ時間 19,902 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 165 ms
78,600 KB
testcase_01 AC 183 ms
78,624 KB
testcase_02 AC 136 ms
78,524 KB
testcase_03 AC 375 ms
78,768 KB
testcase_04 AC 408 ms
78,872 KB
testcase_05 AC 150 ms
78,512 KB
testcase_06 AC 331 ms
78,540 KB
testcase_07 AC 128 ms
78,524 KB
testcase_08 AC 125 ms
78,844 KB
testcase_09 AC 216 ms
78,624 KB
testcase_10 AC 376 ms
78,820 KB
testcase_11 AC 409 ms
78,640 KB
testcase_12 AC 322 ms
78,704 KB
testcase_13 AC 168 ms
78,544 KB
testcase_14 AC 128 ms
78,628 KB
testcase_15 AC 357 ms
78,556 KB
testcase_16 AC 157 ms
78,644 KB
testcase_17 AC 410 ms
78,832 KB
testcase_18 AC 216 ms
78,824 KB
testcase_19 AC 211 ms
78,768 KB
testcase_20 AC 327 ms
78,884 KB
testcase_21 AC 376 ms
78,752 KB
testcase_22 AC 298 ms
78,404 KB
testcase_23 AC 244 ms
78,792 KB
testcase_24 AC 153 ms
78,532 KB
testcase_25 AC 240 ms
78,668 KB
testcase_26 AC 229 ms
78,648 KB
testcase_27 AC 374 ms
78,900 KB
testcase_28 AC 173 ms
78,612 KB
testcase_29 AC 180 ms
78,452 KB
testcase_30 AC 439 ms
78,768 KB
testcase_31 AC 190 ms
78,632 KB
testcase_32 AC 143 ms
78,492 KB
testcase_33 AC 334 ms
78,712 KB
testcase_34 AC 380 ms
78,832 KB
testcase_35 AC 200 ms
78,500 KB
testcase_36 AC 378 ms
78,604 KB
testcase_37 AC 211 ms
78,660 KB
testcase_38 AC 357 ms
78,788 KB
testcase_39 AC 180 ms
78,736 KB
testcase_40 AC 431 ms
78,924 KB
testcase_41 AC 442 ms
78,560 KB
testcase_42 AC 444 ms
78,944 KB
testcase_43 AC 434 ms
78,872 KB
testcase_44 AC 453 ms
78,948 KB
testcase_45 AC 445 ms
78,920 KB
testcase_46 AC 442 ms
78,792 KB
testcase_47 AC 442 ms
78,880 KB
testcase_48 AC 461 ms
78,804 KB
testcase_49 AC 468 ms
78,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s=int(input())
MOD=10**9+7
inv=pow(2,MOD-2,MOD)
for _ in range(s):
  n,m,k=map(int,input().split())
  if k==0:
    print(((pow(1-m,n,MOD)+pow(m+1,n,MOD))*inv)%MOD)
  else:
    print(((pow(1+m,n,MOD)-pow(1-m,n,MOD))*inv)%MOD)
0