結果

問題 No.2443 特殊線形群の標準表現
ユーザー hiro1729hiro1729
提出日時 2023-08-25 22:35:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 693 bytes
コンパイル時間 1,343 ms
コンパイル使用メモリ 86,752 KB
実行使用メモリ 825,624 KB
最終ジャッジ日時 2023-08-25 22:35:31
合計ジャッジ時間 7,969 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,184 KB
testcase_01 AC 68 ms
71,160 KB
testcase_02 AC 69 ms
71,288 KB
testcase_03 AC 70 ms
71,080 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 68 ms
71,264 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 MLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n, md, q = map(int, input().split())
a = [[list(map(int, input().split())), list(map(int, input().split()))] for _ in range(n)]
b = [[[1, 0], [0, 1]]]
for i in a[::-1]:
	b.append([[b[-1][0][0] * i[0][0] + b[-1][0][1] * i[1][0], b[-1][0][0] * i[0][1] + b[-1][0][1] * i[1][1]], [b[-1][1][0] * i[0][0] + b[-1][1][1] * i[1][0], b[-1][1][0] * i[0][1] + b[-1][1][1] * i[1][1]]])
for _ in range(q):
	l, r, x, y = map(int, input().split())
	p = b[n - r]
	q = b[n - l]
	c = p[1][1]
	d = -p[0][1]
	e = -p[1][0]
	f = -p[0][0]
	g = q[0][0]
	h = q[0][1]
	i = q[1][0]
	j = q[1][1]
	s = c * g + d * i
	t = c * h + d * j
	u = e * g + f * i
	v = e * h + f * j
	print((s * x + t * y) % md, (u * x + v * y) % md)
0