結果
問題 | No.629 グラフの中に眠る門松列 |
ユーザー | rlangevin |
提出日時 | 2023-01-15 01:46:08 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 859 bytes |
コンパイル時間 | 1,283 ms |
コンパイル使用メモリ | 86,984 KB |
実行使用メモリ | 76,724 KB |
最終ジャッジ日時 | 2023-08-27 05:39:24 |
合計ジャッジ時間 | 10,498 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 73 ms
71,360 KB |
testcase_01 | AC | 74 ms
71,240 KB |
testcase_02 | AC | 74 ms
71,340 KB |
testcase_03 | AC | 76 ms
71,116 KB |
testcase_04 | AC | 75 ms
71,372 KB |
testcase_05 | AC | 74 ms
71,352 KB |
testcase_06 | AC | 74 ms
71,240 KB |
testcase_07 | AC | 73 ms
71,348 KB |
testcase_08 | AC | 75 ms
71,284 KB |
testcase_09 | AC | 74 ms
71,232 KB |
testcase_10 | AC | 76 ms
71,452 KB |
testcase_11 | AC | 75 ms
71,156 KB |
testcase_12 | AC | 75 ms
71,084 KB |
testcase_13 | AC | 75 ms
71,152 KB |
testcase_14 | AC | 75 ms
71,284 KB |
testcase_15 | AC | 77 ms
71,356 KB |
testcase_16 | AC | 76 ms
71,284 KB |
testcase_17 | AC | 76 ms
71,160 KB |
testcase_18 | AC | 76 ms
71,244 KB |
testcase_19 | AC | 77 ms
71,412 KB |
testcase_20 | AC | 77 ms
71,400 KB |
testcase_21 | AC | 425 ms
76,724 KB |
testcase_22 | AC | 80 ms
71,060 KB |
testcase_23 | AC | 78 ms
71,336 KB |
testcase_24 | AC | 82 ms
76,256 KB |
testcase_25 | TLE | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
testcase_38 | -- | - |
testcase_39 | -- | - |
testcase_40 | -- | - |
testcase_41 | -- | - |
ソースコード
import sys sys.setrecursionlimit(10**7) readline = sys.stdin.readline import pypyjit pypyjit.set_param('max_unroll_recursion=-1') def kadomatsu(a, b, c): for i in [-1, 1]: if a * i < b * i and b * i > c * i and a != c: return True return False def dfs(s, L): if len(L) == 3: if kadomatsu(A[L[0]], A[L[1]], A[L[2]]): print("YES") exit() for u in G[s]: if u in L: continue L.append(u) dfs(u, L) L.pop() return N, M = map(int, readline().split()) A = list(map(int, readline().split())) G = [[] for i in range(N)] for i in range(M): u, v = map(int, readline().split()) u, v = u - 1, v - 1 if A[u] == A[v]: continue G[u].append(v) G[v].append(u) for i in range(N): dfs(i, [i]) print("NO")