結果
問題 |
No.3225 2×2行列相似判定 〜easy〜
|
ユーザー |
![]() |
提出日時 | 2025-08-11 22:05:22 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,001 bytes |
コンパイル時間 | 316 ms |
コンパイル使用メモリ | 82,184 KB |
実行使用メモリ | 93,772 KB |
最終ジャッジ日時 | 2025-08-11 22:05:29 |
合計ジャッジ時間 | 7,233 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | TLE * 1 -- * 2 |
other | -- * 33 |
ソースコード
import sys input = sys.stdin.readline mod=67 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 def plus(A,B,k,l):# a,B:k*l C=[[None for i in range(l)] for j in range(k)] for i in range(k): for j in range(l): C[i][j]=(A[i][j]+B[i][j])%mod return C A,B=map(int,input().split()) C,D=map(int,input().split()) A2,B2=map(int,input().split()) C2,D2=map(int,input().split()) X=[[A,B],[C,D]] Y=[[A2,B2],[C2,D2]] flag=0 for a in range(67): for b in range(67): for c in range(67): for d in range(67): if a*d-b*c==0: continue P=[[a,b],[c,d]] if prod(P,X,2,2,2)==prod(P,Y,2,2,2): flag=1 if flag: print("Yes") else: print("No")