結果

問題 No.3196 Unique Nickname
ユーザー GOTKAKO
提出日時 2025-07-11 21:23:13
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 391 bytes
コンパイル時間 2,070 ms
コンパイル使用メモリ 203,172 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-07-11 21:23:19
合計ジャッジ時間 2,519 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int N; cin >> N;
    map<string,int> S;
    vector<pair<string,string>> ST(N);
    for(auto &[s,t] : ST) cin >> s >> t,S[s]++,S[t]++;

    for(auto &[s,t] : ST){
        if(S[s] == 1 || S[t] == 1){}
        else{cout << "No\n"; return 0;}
    }
    cout << "Yes\n";
}
0