結果

問題 No.488 四角関係
ユーザー 👑 KazunKazun
提出日時 2020-06-02 18:48:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,749 ms / 5,000 ms
コード長 528 bytes
コンパイル時間 553 ms
コンパイル使用メモリ 87,004 KB
実行使用メモリ 81,944 KB
最終ジャッジ日時 2023-08-15 22:14:02
合計ジャッジ時間 9,712 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 314 ms
78,448 KB
testcase_01 AC 490 ms
81,740 KB
testcase_02 AC 396 ms
79,852 KB
testcase_03 AC 334 ms
79,996 KB
testcase_04 AC 408 ms
81,512 KB
testcase_05 AC 594 ms
81,512 KB
testcase_06 AC 451 ms
79,224 KB
testcase_07 AC 972 ms
81,312 KB
testcase_08 AC 1,749 ms
81,368 KB
testcase_09 AC 64 ms
71,436 KB
testcase_10 AC 252 ms
78,724 KB
testcase_11 AC 133 ms
78,632 KB
testcase_12 AC 334 ms
81,944 KB
testcase_13 AC 249 ms
79,288 KB
testcase_14 AC 149 ms
78,524 KB
testcase_15 AC 99 ms
77,664 KB
testcase_16 AC 63 ms
71,388 KB
testcase_17 AC 60 ms
71,368 KB
testcase_18 AC 79 ms
76,656 KB
testcase_19 AC 90 ms
76,780 KB
testcase_20 AC 68 ms
75,628 KB
testcase_21 AC 64 ms
71,484 KB
testcase_22 AC 72 ms
76,108 KB
testcase_23 AC 68 ms
71,292 KB
testcase_24 AC 88 ms
76,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

E=set()
for i in range(M):
    a,b=map(int,input().split())
    E.add((a,b))

def f(a,b):
    return (min(a,b),max(a,b)) in E


S=0
for x in range(N):
    for y in range(N):
        if x!=y:
            for z in range(N):
                if x!=z and y!=z:
                    for w in range(N):
                        if x!=w and y!=w and z!=w:
                            S+=(f(x,y) and f(y,z) and f(z,w) and f(w,x) and (not f(x,z)) and (not f(y,w)))
                                
print(S//8)
0