結果
| 問題 | No.3196 Unique Nickname |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-07-11 21:22:43 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 433µs | |
| コード長 | 530 bytes |
| 記録 | |
| コンパイル時間 | 2,311 ms |
| コンパイル使用メモリ | 342,084 KB |
| 実行使用メモリ | 9,408 KB |
| 最終ジャッジ日時 | 2026-07-13 02:57:35 |
| 合計ジャッジ時間 | 3,672 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll =long long;
void solve(){
map<string,ll> M;
ll N;
cin>>N;
vector<string> S(N),T(N);
for(int i=0;i<N;i++){
cin>>S[i]>>T[i];
M[S[i]]++;
M[T[i]]++;
}
bool OK=1;
for(int i=0;i<N;i++){
if(M[S[i]]>1&&M[T[i]]>1){
cout<<"No\n";
return;
}
}
cout<<"Yes\n";
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T=1;
// cin>>T;
while(T--)solve();
}