結果
問題 | No.488 四角関係 |
ユーザー | ああいい |
提出日時 | 2022-03-24 19:08:24 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 767 bytes |
コンパイル時間 | 181 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 77,288 KB |
最終ジャッジ日時 | 2024-04-21 04:23:07 |
合計ジャッジ時間 | 3,945 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 178 ms
77,288 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | AC | 196 ms
77,228 KB |
testcase_09 | AC | 40 ms
52,224 KB |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 70 ms
68,992 KB |
testcase_16 | WA | - |
testcase_17 | AC | 41 ms
52,224 KB |
testcase_18 | AC | 45 ms
58,752 KB |
testcase_19 | WA | - |
testcase_20 | AC | 42 ms
52,352 KB |
testcase_21 | AC | 46 ms
51,968 KB |
testcase_22 | AC | 41 ms
52,224 KB |
testcase_23 | AC | 42 ms
52,224 KB |
testcase_24 | WA | - |
ソースコード
N,M = map(int,input().split()) G = [set() for _ in range(N+1)] for _ in range(M): a,b = map(int,input().split()) G[a].add(b) G[b].add(a) ans = 0 for i in range(1,N+1): for j in range(i+1,N+1): for k in range(j+1,N+1): for l in range(k+1,N+1): s = [i,j,k,l] count = [0] * 4 for t in range(4): for y in range(4): if t == y:continue if s[y] in G[s[t]]: count[t] += 1 flag = True for t in count: if t != 2: flag = False break if flag: ans += 1 print(ans)