結果

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

ソースコード

diff #

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

int main(){
    int n;cin>>n;
    vector<string> s(n),t(n);
    map<string,int> mp;
    for(int i=0;i<n;i++){
        cin>>s[i]>>t[i];
        mp[s[i]]++;
        mp[t[i]]++;
    }
    bool ok=true;
    for(int i=0;i<n;i++){
        if(mp[s[i]]!=1&&mp[t[i]]!=1)ok=false;
    }
    cout<<(ok?"Yes\n":"No\n");
}
0