結果
問題 | No.1610 She Loves Me, She Loves Me Not, ... |
ユーザー | mkawa2 |
提出日時 | 2022-11-15 11:55:21 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
AC
|
実行時間 | 27 ms / 2,000 ms |
コード長 | 1,096 bytes |
コンパイル時間 | 872 ms |
コンパイル使用メモリ | 10,940 KB |
実行使用メモリ | 9,972 KB |
最終ジャッジ日時 | 2023-10-14 17:42:46 |
合計ジャッジ時間 | 3,736 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 13 ms
8,332 KB |
testcase_01 | AC | 16 ms
9,440 KB |
testcase_02 | AC | 13 ms
8,236 KB |
testcase_03 | AC | 14 ms
8,268 KB |
testcase_04 | AC | 15 ms
8,352 KB |
testcase_05 | AC | 26 ms
9,968 KB |
testcase_06 | AC | 26 ms
9,872 KB |
testcase_07 | AC | 26 ms
9,960 KB |
testcase_08 | AC | 27 ms
9,876 KB |
testcase_09 | AC | 26 ms
9,832 KB |
testcase_10 | AC | 27 ms
9,876 KB |
testcase_11 | AC | 26 ms
9,948 KB |
testcase_12 | AC | 27 ms
9,880 KB |
testcase_13 | AC | 26 ms
9,972 KB |
testcase_14 | AC | 15 ms
8,436 KB |
testcase_15 | AC | 14 ms
8,336 KB |
testcase_16 | AC | 15 ms
8,300 KB |
testcase_17 | AC | 14 ms
8,332 KB |
testcase_18 | AC | 15 ms
8,452 KB |
testcase_19 | AC | 15 ms
8,320 KB |
testcase_20 | AC | 15 ms
8,392 KB |
testcase_21 | AC | 14 ms
8,336 KB |
testcase_22 | AC | 15 ms
8,484 KB |
testcase_23 | AC | 14 ms
8,388 KB |
testcase_24 | AC | 13 ms
8,248 KB |
testcase_25 | AC | 14 ms
8,236 KB |
testcase_26 | AC | 13 ms
8,204 KB |
testcase_27 | AC | 13 ms
8,316 KB |
testcase_28 | AC | 14 ms
8,268 KB |
testcase_29 | AC | 13 ms
8,240 KB |
testcase_30 | AC | 14 ms
8,248 KB |
testcase_31 | AC | 14 ms
8,304 KB |
testcase_32 | AC | 13 ms
8,300 KB |
testcase_33 | AC | 14 ms
8,388 KB |
testcase_34 | AC | 14 ms
8,220 KB |
testcase_35 | AC | 14 ms
8,224 KB |
ソースコード
import sys # sys.setrecursionlimit(200005) int1 = lambda x: int(x)-1 pDB = lambda *x: print(*x, end="\n", file=sys.stderr) p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr) def II(): return int(sys.stdin.readline()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def LI1(): return list(map(int1, sys.stdin.readline().split())) def LLI1(rows_number): return [LI1() for _ in range(rows_number)] def SI(): return sys.stdin.readline().rstrip() dij = [(0, 1), (-1, 0), (0, -1), (1, 0)] # dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)] inf = (1 << 63)-1 # inf = (1 << 31)-1 # md = 10**9+7 md = 998244353 n, m = LI() to = [set() for _ in range(n)] for _ in range(m): u, v = LI1() to[u].add(v) to[v].add(u) st = [] for u in range(n): if len(to[u]) == 1: st.append(u) cnt = 0 while st: u = st.pop() if not to[u]: continue cnt ^= 1 for v in to[u]: to[v].discard(u) if len(to[v]) == 1: st.append(v) print("Yes" if cnt else "No")