結果
| 問題 |
No.3225 2×2行列相似判定 〜easy〜
|
| ユーザー |
|
| 提出日時 | 2025-08-11 04:41:00 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 549 bytes |
| コンパイル時間 | 303 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 47,608 KB |
| 最終ジャッジ日時 | 2025-08-11 04:41:08 |
| 合計ジャッジ時間 | 7,185 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | TLE * 1 -- * 2 |
| other | -- * 33 |
ソースコード
import numpy as np
p = 67
A = np.array([list(map(int, input().split())), list(map(int, input().split()))])
B = np.array([list(map(int, input().split())), list(map(int, input().split()))])
for w in range(p) :
for x in range(p) :
for y in range(p) :
for z in range(p) :
if (w * z - x * y) % p == 0 :
continue
P = np.array([[w, x], [y, z]])
PA = P @ A
BP = B @ P
ok = True
for i in range(2) :
for j in range(2) :
ok = ok and (PA[i, j] % p == BP[i, j])
if ok :
print("Yes")
exit()
print("No")