結果

問題 No.2443 特殊線形群の標準表現
ユーザー titiatitia
提出日時 2023-08-28 03:07:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 867 bytes
コンパイル時間 1,602 ms
コンパイル使用メモリ 86,804 KB
実行使用メモリ 145,004 KB
最終ジャッジ日時 2023-08-28 03:07:33
合計ジャッジ時間 9,129 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,152 KB
testcase_01 AC 71 ms
71,316 KB
testcase_02 AC 72 ms
71,048 KB
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 -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N,mod,Q=map(int,input().split())

def prod(A,B,k,l,m):# A:k*l,B:l*m
    C=[[None for i in range(m)] for j in range(k)]

    for i in range(k):
        for j in range(m):
            ANS=0
            for pl in range(l):
                ANS=(ANS+A[i][pl]*B[pl][j])%mod

            C[i][j]=ANS

    return C

A=[]

for i in range(N):
    x,y=map(int,input().split())
    z,w=map(int,input().split())

    A.append([[x,y],[z,w]])


S=[[[1,0],[0,1]]]

for i in range(N):
    a=A[i]

    S.append(prod(a,S[-1],2,2,2))

for tests in range(Q):
    l,r,x,y=map(int,input().split())
    if l==r:
        print(x,y)
        continue

    k=S[l]
    k0,k1=k[0]
    k2,k3=k[1]

    L= prod(S[r],[[k3,-k1],[-k2,k0]],2,2,2)

    #print(S[r],k,[[k3,-k1],[-k2,k0]],L)

    k0,k1=L[0]
    k2,k3=L[1]

    print(x*k0+y*k1,x*k2+y*k3)

    

    
0