結果
問題 | No.488 四角関係 |
ユーザー |
![]() |
提出日時 | 2023-06-12 04:54:30 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 610 ms / 5,000 ms |
コード長 | 661 bytes |
コンパイル時間 | 295 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-06-11 08:35:07 |
合計ジャッジ時間 | 3,219 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
N,M=map(int,input().split())E=[tuple(map(int,input().split())) for i in range(M)]S=set(E)ANS=0for i in range(N):for j in range(i+1,N):for k in range(j+1,N):for l in range(k+1,N):if (i,j) in S and (j,k) in S and (k,l) in S and (i,l) in S and not ((i,k) in S) and not ((j,l) in S):ANS+=1if (i,j) in S and (j,l) in S and (k,l) in S and (i,k) in S and not ((i,l) in S) and not ((j,k) in S):ANS+=1if (i,k) in S and (j,k) in S and (j,l) in S and (i,l) in S and not ((i,j) in S) and not ((k,l) in S):ANS+=1print(ANS)