結果
| 問題 |
No.3196 Unique Nickname
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2025-07-11 22:43:23 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 36 ms / 2,000 ms |
| コード長 | 426 bytes |
| コンパイル時間 | 256 ms |
| コンパイル使用メモリ | 12,288 KB |
| 実行使用メモリ | 10,240 KB |
| 最終ジャッジ日時 | 2025-07-11 22:43:25 |
| 合計ジャッジ時間 | 1,760 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
from collections import Counter
N=int(input())
A=[input().split() for i in range(N)]
flag=1
for i in range(N):
a,b=A[i]
count1=0
count2=0
for j in range(N):
if i!=j:
c,d=A[j]
if (a==c or a==d):
count1=1
if (b==c or b==d):
count2=1
if count1==1 and count2==1:
flag=0
if flag:
print("Yes")
else:
print("No")
titia