結果

問題 No.1258 コインゲーム
ユーザー kojihashimoto-kobekojihashimoto-kobe
提出日時 2022-04-25 19:23:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 615 ms / 2,000 ms
コード長 237 bytes
コンパイル時間 1,353 ms
コンパイル使用メモリ 84,152 KB
実行使用メモリ 79,140 KB
最終ジャッジ日時 2023-09-09 22:10:29
合計ジャッジ時間 28,657 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 212 ms
78,480 KB
testcase_01 AC 234 ms
78,532 KB
testcase_02 AC 169 ms
78,468 KB
testcase_03 AC 476 ms
78,600 KB
testcase_04 AC 522 ms
78,644 KB
testcase_05 AC 190 ms
78,296 KB
testcase_06 AC 413 ms
78,580 KB
testcase_07 AC 156 ms
78,448 KB
testcase_08 AC 149 ms
78,372 KB
testcase_09 AC 271 ms
78,580 KB
testcase_10 AC 473 ms
78,424 KB
testcase_11 AC 519 ms
78,760 KB
testcase_12 AC 406 ms
78,916 KB
testcase_13 AC 216 ms
78,264 KB
testcase_14 AC 156 ms
78,256 KB
testcase_15 AC 460 ms
78,704 KB
testcase_16 AC 191 ms
78,256 KB
testcase_17 AC 513 ms
78,656 KB
testcase_18 AC 274 ms
78,580 KB
testcase_19 AC 264 ms
78,644 KB
testcase_20 AC 409 ms
78,440 KB
testcase_21 AC 489 ms
78,772 KB
testcase_22 AC 378 ms
78,748 KB
testcase_23 AC 315 ms
78,768 KB
testcase_24 AC 193 ms
78,432 KB
testcase_25 AC 302 ms
78,644 KB
testcase_26 AC 281 ms
78,576 KB
testcase_27 AC 485 ms
78,600 KB
testcase_28 AC 220 ms
78,712 KB
testcase_29 AC 227 ms
78,640 KB
testcase_30 AC 564 ms
78,708 KB
testcase_31 AC 232 ms
78,524 KB
testcase_32 AC 173 ms
78,472 KB
testcase_33 AC 424 ms
78,704 KB
testcase_34 AC 491 ms
78,576 KB
testcase_35 AC 256 ms
78,528 KB
testcase_36 AC 492 ms
78,580 KB
testcase_37 AC 266 ms
78,756 KB
testcase_38 AC 457 ms
78,564 KB
testcase_39 AC 220 ms
78,772 KB
testcase_40 AC 560 ms
79,040 KB
testcase_41 AC 561 ms
78,904 KB
testcase_42 AC 570 ms
78,896 KB
testcase_43 AC 601 ms
78,796 KB
testcase_44 AC 570 ms
79,140 KB
testcase_45 AC 558 ms
78,640 KB
testcase_46 AC 560 ms
78,800 KB
testcase_47 AC 561 ms
78,904 KB
testcase_48 AC 615 ms
78,904 KB
testcase_49 AC 571 ms
78,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s = int(input())
mod = 1000000007

for _ in range(s):
  n,m,x = map(int,input().split())
  if x == 0:
    print((pow(1+m,n,mod)+pow(1-m,n,mod))*pow(2,mod-2,mod)%mod)
  else:
    print((pow(1+m,n,mod)-pow(1-m,n,mod))*pow(2,mod-2,mod)%mod)
0