結果

問題 No.488 四角関係
ユーザー titiatitia
提出日時 2023-06-12 04:50:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 587 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 10,908 KB
実行使用メモリ 8,276 KB
最終ジャッジ日時 2023-09-02 01:52:21
合計ジャッジ時間 2,489 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 387 ms
8,276 KB
testcase_09 AC 15 ms
7,960 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 15 ms
7,964 KB
testcase_16 AC 15 ms
7,992 KB
testcase_17 AC 15 ms
7,864 KB
testcase_18 AC 15 ms
7,956 KB
testcase_19 WA -
testcase_20 AC 15 ms
7,812 KB
testcase_21 AC 14 ms
7,852 KB
testcase_22 AC 15 ms
7,824 KB
testcase_23 AC 15 ms
7,868 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

E=[tuple(map(int,input().split())) for i in range(M)]
S=set(E)

ANS=0
for i in range(N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            for l in range(k+1,N):
                if (i,j) in S and (j,k) in S and (k,l) in S and (i,l) in S and not ((i,k) in S) and not ((j,l) in S):
                    #print(i,j,k,l)
                    ANS+=1

                if (i,j) in S and (j,l) in S and (k,l) in S and (i,k) in S and not ((i,l) in S) and not ((j,k) in S):
                    #print(i,j,k,l)
                    ANS+=1

print(ANS)
0