結果

問題 No.2443 特殊線形群の標準表現
ユーザー ニックネームニックネーム
提出日時 2023-08-25 22:20:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,513 ms / 3,000 ms
コード長 542 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 10,792 KB
実行使用メモリ 32,480 KB
最終ジャッジ日時 2023-08-25 22:21:08
合計ジャッジ時間 11,053 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,772 KB
testcase_01 AC 14 ms
7,852 KB
testcase_02 AC 14 ms
7,856 KB
testcase_03 AC 14 ms
7,772 KB
testcase_04 AC 13 ms
7,788 KB
testcase_05 AC 13 ms
7,776 KB
testcase_06 AC 14 ms
7,780 KB
testcase_07 AC 13 ms
7,780 KB
testcase_08 AC 14 ms
7,768 KB
testcase_09 AC 13 ms
7,820 KB
testcase_10 AC 13 ms
7,856 KB
testcase_11 AC 13 ms
7,856 KB
testcase_12 AC 14 ms
7,912 KB
testcase_13 AC 27 ms
8,388 KB
testcase_14 AC 157 ms
10,752 KB
testcase_15 AC 1,469 ms
32,412 KB
testcase_16 AC 1,480 ms
32,352 KB
testcase_17 AC 1,477 ms
32,372 KB
testcase_18 AC 1,470 ms
32,300 KB
testcase_19 AC 1,513 ms
32,344 KB
testcase_20 AC 1,391 ms
32,480 KB
権限があれば一括ダウンロードができます

ソースコード

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)%b,(z21*x+z22*y)%b)
0