結果

問題 No.2664 Prime Sum
ユーザー ShirotsumeShirotsume
提出日時 2024-03-08 21:07:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 627 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 67,196 KB
最終ジャッジ日時 2024-03-08 21:07:44
合計ジャッジ時間 3,058 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
56,144 KB
testcase_01 AC 42 ms
56,144 KB
testcase_02 AC 42 ms
56,144 KB
testcase_03 AC 42 ms
56,144 KB
testcase_04 AC 42 ms
56,144 KB
testcase_05 AC 49 ms
63,872 KB
testcase_06 AC 49 ms
63,936 KB
testcase_07 AC 44 ms
56,144 KB
testcase_08 AC 46 ms
58,204 KB
testcase_09 AC 46 ms
58,204 KB
testcase_10 AC 46 ms
58,204 KB
testcase_11 AC 42 ms
56,144 KB
testcase_12 AC 45 ms
58,204 KB
testcase_13 AC 50 ms
63,872 KB
testcase_14 AC 53 ms
67,184 KB
testcase_15 AC 55 ms
67,188 KB
testcase_16 AC 53 ms
67,184 KB
testcase_17 WA -
testcase_18 AC 46 ms
58,204 KB
testcase_19 AC 46 ms
58,204 KB
testcase_20 AC 53 ms
65,012 KB
testcase_21 AC 54 ms
67,196 KB
testcase_22 AC 49 ms
63,908 KB
testcase_23 AC 54 ms
67,160 KB
testcase_24 AC 54 ms
67,160 KB
testcase_25 AC 55 ms
65,012 KB
testcase_26 AC 44 ms
56,144 KB
testcase_27 AC 43 ms
56,144 KB
testcase_28 AC 43 ms
56,144 KB
testcase_29 AC 43 ms
56,144 KB
testcase_30 AC 46 ms
56,144 KB
testcase_31 AC 42 ms
56,144 KB
testcase_32 AC 42 ms
56,144 KB
testcase_33 AC 43 ms
56,144 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 42 ms
56,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, time, random
from collections import deque, Counter, defaultdict
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 61 - 1
mod = 998244353

n, m = mi()
graph = [[] for _ in range(n)]
for _ in range(m):
    a, b = mi()
    graph[a - 1].append(b - 1)
    graph[b - 1].append(a - 1)
    
# is bipartite

color = [-1] * n
def dfs(v, c):
    color[v] = c
    for u in graph[v]:
        if color[u] == -1:
            dfs(u, c ^ 1)
        elif color[u] == c:
            print('No')
            exit()
dfs(0, 0)

print('Yes')
0