結果

問題 No.1275 綺麗な式
ユーザー ygd.ygd.
提出日時 2020-11-25 00:30:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 397 bytes
コンパイル時間 652 ms
コンパイル使用メモリ 10,756 KB
実行使用メモリ 29,636 KB
最終ジャッジ日時 2023-10-01 01:24:19
合計ジャッジ時間 12,738 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 135 ms
29,348 KB
testcase_31 AC 139 ms
29,336 KB
testcase_32 WA -
testcase_33 AC 135 ms
29,448 KB
testcase_34 AC 135 ms
29,312 KB
testcase_35 AC 136 ms
29,636 KB
testcase_36 AC 135 ms
29,352 KB
testcase_37 AC 136 ms
29,420 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 138 ms
29,448 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 134 ms
29,428 KB
testcase_47 AC 137 ms
29,392 KB
testcase_48 AC 137 ms
29,288 KB
testcase_49 AC 136 ms
29,476 KB
testcase_50 AC 137 ms
29,300 KB
testcase_51 AC 137 ms
29,284 KB
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
testcase_61 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
MOD = pow(10,9)+7
a,b = map(int,input().split())
n = int(input())
A = np.array([[2*a, b - a**2], [1, 0]])
#print(A)
MAX = 70
L = [A]
for i in range(MAX):
  A = np.dot(A,A)
  A = np.mod(A, MOD)
  L.append(A)
#print(L)
X = np.array([[1, 0], [0, 1]])
for i in range(MAX):
  if (n-1>>i)&1 == 1:
    X = np.dot(X,L[i])
    X = np.mod(X,MOD)
ans = X[0,0]*2*a + X[0,1]*2
print(ans%MOD)
0