結果

問題 No.488 四角関係
ユーザー 👑 KazunKazun
提出日時 2020-06-02 18:48:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,712 ms / 5,000 ms
コード長 528 bytes
コンパイル時間 540 ms
コンパイル使用メモリ 82,076 KB
実行使用メモリ 79,232 KB
最終ジャッジ日時 2024-05-03 08:40:57
合計ジャッジ時間 8,544 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 332 ms
77,216 KB
testcase_01 AC 460 ms
79,028 KB
testcase_02 AC 362 ms
78,568 KB
testcase_03 AC 292 ms
79,032 KB
testcase_04 AC 366 ms
79,140 KB
testcase_05 AC 536 ms
79,220 KB
testcase_06 AC 397 ms
77,452 KB
testcase_07 AC 902 ms
79,232 KB
testcase_08 AC 1,712 ms
78,628 KB
testcase_09 AC 35 ms
52,836 KB
testcase_10 AC 211 ms
78,128 KB
testcase_11 AC 104 ms
76,992 KB
testcase_12 AC 288 ms
78,888 KB
testcase_13 AC 220 ms
78,768 KB
testcase_14 AC 124 ms
77,600 KB
testcase_15 AC 67 ms
74,924 KB
testcase_16 AC 34 ms
53,380 KB
testcase_17 AC 33 ms
52,716 KB
testcase_18 AC 50 ms
66,680 KB
testcase_19 AC 58 ms
71,532 KB
testcase_20 AC 38 ms
59,096 KB
testcase_21 AC 33 ms
52,484 KB
testcase_22 AC 38 ms
61,412 KB
testcase_23 AC 33 ms
52,880 KB
testcase_24 AC 58 ms
71,900 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