結果
問題 |
No.488 四角関係
|
ユーザー |
|
提出日時 | 2018-08-31 21:29:45 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 531 bytes |
コンパイル時間 | 135 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 44,464 KB |
最終ジャッジ日時 | 2024-09-13 22:46:20 |
合計ジャッジ時間 | 16,110 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 RE * 2 |
other | AC * 1 RE * 21 |
ソースコード
from itertools import permutations import numpy as np def solve(): n, m = map(int, input().split()) if n < 4: return 0 node = np.zeros((n, n), dtype=np.bool) for _ in range(m): a, b = map(int, input().split()) node[a][b] = node[b][a] = 1 ans = set() for a, b, c, d in permutations(range(n), 4): if (node[a][b] == node[b][c] == node[c][d] == node[d][a] == 1) and (node[a][c] == node[b][d] == 0): ans.add(frozenset([a, b, c, d])) return len(ans) print(solve())