結果

問題 No.2443 特殊線形群の標準表現
ユーザー ニックネームニックネーム
提出日時 2023-08-25 22:19:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 534 bytes
コンパイル時間 706 ms
コンパイル使用メモリ 10,888 KB
実行使用メモリ 32,476 KB
最終ジャッジ日時 2023-08-25 22:19:37
合計ジャッジ時間 12,377 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,752 KB
testcase_01 AC 16 ms
7,848 KB
testcase_02 AC 15 ms
7,788 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 16 ms
7,916 KB
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 -
権限があれば一括ダウンロードができます

ソースコード

diff #

def mul(x,y):
    x11,x12,x21,x22 = x; y11,y12,y21,y22 = y
    return (x11*y11+x12*y21)%b,(x11*y12+x12*y22)%b,(x21*y11+x22*y21)%b,(x21*y12+x22*y22)%b
n,b,q = map(int,input().split())
a = [(1,0,0,1)]
for _ in range(n):
    a1 = list(map(int,input().split()))
    a2 = list(map(int,input().split()))
    a.append(a1+a2)
for i in range(n): a[i+1] = mul(a[i+1],a[i])
for _ in range(q):
    l,r,x,y = map(int,input().split())
    l11,l12,l21,l22 = a[l]
    z11,z12,z21,z22 = mul(a[r],(l22,-l12,-l21,l11))
    print(z11*x+z12*y,z21*x+z22*y)
0