結果
問題 |
No.3196 Unique Nickname
|
ユーザー |
![]() |
提出日時 | 2025-07-11 21:24:30 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 45 ms / 2,000 ms |
コード長 | 324 bytes |
コンパイル時間 | 182 ms |
コンパイル使用メモリ | 81,900 KB |
実行使用メモリ | 55,608 KB |
最終ジャッジ日時 | 2025-07-11 21:24:38 |
合計ジャッジ時間 | 1,831 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
from collections import defaultdict N = int(input()) ST = [list(input().split()) for _ in range(N)] D = defaultdict(int) for S, T in ST: D[S] += 1 D[T] += 1 for S, T in ST: D[S] -= 1 D[T] -= 1 if 1 <= min(D[S], D[T]): print("No") break D[S] += 1 D[T] += 1 else: print("Yes")