結果
| 問題 |
No.488 四角関係
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-08-31 21:35:25 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 697 bytes |
| コンパイル時間 | 475 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 44,684 KB |
| 最終ジャッジ日時 | 2024-09-13 22:46:58 |
| 合計ジャッジ時間 | 14,741 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 22 |
ソースコード
from itertools import combinations
from sys import stdin, stdout
import numpy as np
input = lambda: stdin.readline().rstrip()
write = stdout.write
def main():
N, M = map(int, input().split())
AB = [tuple(map(int, input().split())) for _ in [0] * M]
edge = np.zeros((n, n))
for a, b in AB:
edge[a][b] = edge[b][a] = 1
square = 0
for a, b, c, d in combinations(range(N), 4):
if all((edge[a][b] + edge[a][c] + edge[a][d] == 2,
edge[b][a] + edge[b][c] + edge[b][d] == 2,
edge[c][a] + edge[c][b] + edge[c][d] == 2,
edge[d][a] + edge[d][b] + edge[d][c] == 2)):
square += 1
print(square)
main()