結果

問題 No.3196 Unique Nickname
コンテスト
ユーザー i_taku
提出日時 2025-07-14 13:43:35
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 74 ms / 2,000 ms
+ 693µs
コード長 318 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 233 ms
コンパイル使用メモリ 95,340 KB
実行使用メモリ 79,324 KB
最終ジャッジ日時 2026-07-13 05:57:26
合計ジャッジ時間 3,022 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from collections import defaultdict


N = int(input())
cnt = defaultdict(int)
S, T = [], []
for _ in range(N):
    s, t = input().split()
    S.append(s)
    T.append(t)
    cnt[s] += 1
    cnt[t] += 1
for s, t in zip(S, T):
    if cnt[s] == 1 or cnt[t] == 1:
        continue
    print('No')
    exit()

print('Yes')
0