結果
| 問題 |
No.3196 Unique Nickname
|
| コンテスト | |
| ユーザー |
ゼリトキ
|
| 提出日時 | 2025-07-11 21:29:09 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 774 bytes |
| コンパイル時間 | 3,196 ms |
| コンパイル使用メモリ | 281,400 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-07-11 21:29:47 |
| 合計ジャッジ時間 | 3,898 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define ll long long
const long long mod=998244353;
const long long hmod=46216567629137;
int main(){
cin.tie(0)->sync_with_stdio(0);
cout.tie(0);
int N;
cin>>N;
bool ok[N+1];
for(int i=1;i<=N;i++) ok[i]=0;
map<string,int>dat;
string S[N+1],T[N+1];
for(int i=1;i<=N;i++){
cin>>S[i]>>T[i];
if(dat.count(S[i])>=1) dat[S[i]]++;
else dat[S[i]]=1;
if(dat.count(T[i])>=1) dat[T[i]]++;
else dat[T[i]]=1;
}
for(int i=1;i<=N;i++){
if(dat[S[i]]==1) ok[i]=1;
if(dat[T[i]]==1) ok[i]=1;
if(!ok[i]){
cout<<"No\n";
return 0;
}
}
cout<<"Yes\n";
}
ゼリトキ