結果

問題 No.488 四角関係
ユーザー 6soukiti296soukiti29
提出日時 2017-03-22 16:43:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 910 ms / 5,000 ms
コード長 455 bytes
コンパイル時間 611 ms
コンパイル使用メモリ 10,928 KB
実行使用メモリ 28,148 KB
最終ジャッジ日時 2023-09-19 05:17:02
合計ジャッジ時間 6,772 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 401 ms
17,844 KB
testcase_01 AC 257 ms
14,088 KB
testcase_02 AC 377 ms
17,152 KB
testcase_03 AC 129 ms
11,088 KB
testcase_04 AC 205 ms
12,772 KB
testcase_05 AC 459 ms
18,792 KB
testcase_06 AC 792 ms
28,148 KB
testcase_07 AC 870 ms
28,144 KB
testcase_08 AC 910 ms
27,948 KB
testcase_09 AC 16 ms
8,212 KB
testcase_10 AC 90 ms
10,032 KB
testcase_11 AC 18 ms
8,336 KB
testcase_12 AC 51 ms
8,948 KB
testcase_13 AC 80 ms
9,788 KB
testcase_14 AC 28 ms
8,436 KB
testcase_15 AC 19 ms
8,324 KB
testcase_16 AC 16 ms
8,260 KB
testcase_17 AC 16 ms
8,260 KB
testcase_18 AC 16 ms
8,208 KB
testcase_19 AC 17 ms
8,172 KB
testcase_20 AC 17 ms
8,284 KB
testcase_21 AC 17 ms
8,176 KB
testcase_22 AC 17 ms
8,316 KB
testcase_23 AC 17 ms
8,268 KB
testcase_24 AC 17 ms
8,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
N,M = map(int,input().split())
glaph = [[0 for i in range(N)] for j in range(N)]
for m in range(M):
	a,b = set(map(int,input().split()))
	glaph[a][b] = 1
	glaph[b][a] = 1
A = [i for i in range(N)]
C = list(itertools.combinations(A,4))
num = 0
for c in C:
	side =[0,0,0,0]
	for i,k in enumerate(c):
		count = 0
		for m in c:
			if glaph[k][m] == 1:
				count = count + 1
		side[i] = count
	if side.count(2) == 4:
		num = num + 1
print(num)
0