結果

問題 No.2443 特殊線形群の標準表現
ユーザー titiatitia
提出日時 2023-08-28 03:08:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 879 bytes
コンパイル時間 1,127 ms
コンパイル使用メモリ 86,900 KB
実行使用メモリ 144,828 KB
最終ジャッジ日時 2023-08-28 03:08:29
合計ジャッジ時間 7,744 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,336 KB
testcase_01 AC 71 ms
71,096 KB
testcase_02 AC 75 ms
71,036 KB
testcase_03 AC 72 ms
71,328 KB
testcase_04 WA -
testcase_05 AC 72 ms
71,168 KB
testcase_06 AC 71 ms
71,360 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 74 ms
71,404 KB
testcase_10 WA -
testcase_11 AC 73 ms
71,076 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 790 ms
143,124 KB
testcase_17 WA -
testcase_18 AC 645 ms
143,144 KB
testcase_19 AC 708 ms
143,372 KB
testcase_20 AC 545 ms
144,828 KB
権限があれば一括ダウンロードができます

ソースコード

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)%mod,(x*k2+y*k3)%mod)

    

    
0