結果

問題 No.2202 贅沢てりたまチキン
ユーザー ああいいああいい
提出日時 2023-02-04 16:03:08
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 592 bytes
コンパイル時間 318 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 846,100 KB
最終ジャッジ日時 2023-09-16 12:42:46
合計ジャッジ時間 6,272 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,088 KB
testcase_01 AC 71 ms
71,284 KB
testcase_02 AC 69 ms
71,380 KB
testcase_03 AC 70 ms
71,280 KB
testcase_04 AC 70 ms
71,336 KB
testcase_05 AC 70 ms
71,580 KB
testcase_06 AC 71 ms
71,376 KB
testcase_07 AC 71 ms
71,312 KB
testcase_08 AC 70 ms
71,212 KB
testcase_09 AC 71 ms
71,316 KB
testcase_10 AC 76 ms
78,156 KB
testcase_11 AC 72 ms
71,072 KB
testcase_12 AC 76 ms
71,432 KB
testcase_13 AC 70 ms
71,280 KB
testcase_14 AC 436 ms
266,532 KB
testcase_15 AC 585 ms
281,484 KB
testcase_16 AC 182 ms
80,596 KB
testcase_17 MLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(10 ** 8)

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

C = 2 * N
parent = list(range(C))
def find(i):
    if parent[i] == i:return i
    parent[i] = find(parent[i])
    return parent[i]
def unite(i,j):
    I = find(i)
    J = find(j)
    if I == J:return False
    parent[I] = J
    parent[i] = J
    return True
def isSame(i,j):
    return find(i) == find(j)
for _ in range(M):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    unite(a,b + N)
    unite(a + N,b)
for i in range(N):
    if find(i) != find(i + N):
        print('No')
        exit()
print('Yes')
0