結果

問題 No.488 四角関係
ユーザー convexineqconvexineq
提出日時 2021-02-09 03:46:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 410 ms / 5,000 ms
コード長 331 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 87,284 KB
実行使用メモリ 77,716 KB
最終ジャッジ日時 2023-09-20 12:45:03
合計ジャッジ時間 5,142 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 228 ms
76,688 KB
testcase_01 AC 183 ms
76,996 KB
testcase_02 AC 229 ms
76,720 KB
testcase_03 AC 133 ms
76,628 KB
testcase_04 AC 162 ms
76,968 KB
testcase_05 AC 251 ms
76,580 KB
testcase_06 AC 361 ms
76,748 KB
testcase_07 AC 410 ms
76,784 KB
testcase_08 AC 356 ms
77,716 KB
testcase_09 AC 72 ms
71,656 KB
testcase_10 AC 119 ms
76,652 KB
testcase_11 AC 86 ms
76,124 KB
testcase_12 AC 102 ms
76,724 KB
testcase_13 AC 117 ms
76,648 KB
testcase_14 AC 90 ms
76,152 KB
testcase_15 AC 82 ms
75,944 KB
testcase_16 AC 75 ms
71,336 KB
testcase_17 AC 72 ms
71,428 KB
testcase_18 AC 78 ms
76,048 KB
testcase_19 AC 80 ms
76,048 KB
testcase_20 AC 71 ms
71,656 KB
testcase_21 AC 70 ms
71,364 KB
testcase_22 AC 71 ms
71,576 KB
testcase_23 AC 70 ms
71,328 KB
testcase_24 AC 80 ms
76,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
g = [[0]*n for _ in range(n)]
for _ in range(m):
    a,b = map(int,input().split())
    g[a][b] = g[b][a] = 1
from itertools import permutations as p
ans = 0
for a,b,c,d in p(range(n),4):
    if g[a][b] == g[b][c] == g[c][d] == g[d][a] == 1 and g[a][c] == g[b][d] == 0:
        ans += 1
print(ans//8)
0