結果

問題 No.488 四角関係
ユーザー mlihua09mlihua09
提出日時 2020-09-16 19:55:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 362 ms / 5,000 ms
コード長 405 bytes
コンパイル時間 389 ms
コンパイル使用メモリ 87,204 KB
実行使用メモリ 77,300 KB
最終ジャッジ日時 2023-09-04 03:50:39
合計ジャッジ時間 5,073 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 203 ms
76,900 KB
testcase_01 AC 169 ms
76,832 KB
testcase_02 AC 192 ms
76,684 KB
testcase_03 AC 125 ms
76,440 KB
testcase_04 AC 149 ms
76,712 KB
testcase_05 AC 225 ms
76,732 KB
testcase_06 AC 311 ms
77,040 KB
testcase_07 AC 362 ms
76,828 KB
testcase_08 AC 345 ms
77,300 KB
testcase_09 AC 73 ms
71,388 KB
testcase_10 AC 109 ms
76,760 KB
testcase_11 AC 84 ms
76,232 KB
testcase_12 AC 98 ms
76,648 KB
testcase_13 AC 105 ms
76,648 KB
testcase_14 AC 87 ms
76,180 KB
testcase_15 AC 76 ms
76,156 KB
testcase_16 AC 70 ms
71,520 KB
testcase_17 AC 71 ms
71,492 KB
testcase_18 AC 74 ms
76,012 KB
testcase_19 AC 78 ms
76,076 KB
testcase_20 AC 70 ms
71,300 KB
testcase_21 AC 71 ms
71,432 KB
testcase_22 AC 71 ms
71,360 KB
testcase_23 AC 70 ms
71,292 KB
testcase_24 AC 78 ms
76,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

N, M = map(int, input().split())

X = [[0] * N for i in range(N)]

for i in range(M):
    
    a, b = map(int, input().split())
    
    X[a][b] = 1
    X[b][a] = 1
ans = 0
    
for i, j, k, l in permutations(range(N), r=4):
    
    if X[i][j] and X[j][k] and X[k][l] and X[l][i] and (not X[i][k]) and (not X[j][l]):
        
        ans += 1
        
print(ans // 8)
0