結果

問題 No.2448 一次変換と面積
ユーザー hiro1729hiro1729
提出日時 2023-08-25 22:07:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 277 bytes
コンパイル時間 928 ms
コンパイル使用メモリ 10,680 KB
実行使用メモリ 7,964 KB
最終ジャッジ日時 2023-08-25 22:07:41
合計ジャッジ時間 2,219 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,748 KB
testcase_01 AC 16 ms
7,760 KB
testcase_02 AC 15 ms
7,848 KB
testcase_03 AC 15 ms
7,884 KB
testcase_04 AC 15 ms
7,748 KB
testcase_05 WA -
testcase_06 AC 15 ms
7,848 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 15 ms
7,768 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 37 ms
7,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
	n, b = map(int, input().split())
	a = [list(map(int, input().split())), list(map(int, input().split()))]
	x = abs(a[0][0] * a[1][1] - a[0][1] * a[1][0])
	ans = (n % b if x == 1 else (pow(x, n, b * (x - 1)) - 1) // (x - 1) % b)
	print(ans * x % b)
0