結果
問題 |
No.3196 Unique Nickname
|
ユーザー |
|
提出日時 | 2025-07-11 21:26:05 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 514 bytes |
コンパイル時間 | 2,071 ms |
コンパイル使用メモリ | 203,116 KB |
実行使用メモリ | 16,156 KB |
最終ジャッジ日時 | 2025-07-11 21:26:16 |
合計ジャッジ時間 | 2,857 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll mod = 1e9 + 7; const int N = 200005; const int INF = 0x3f3f3f3f; string s[N], t[N]; int main() { int n; cin >> n; map<string, int> mp; for (int i = 0; i < n; i++) { cin >> s[i] >> t[i]; mp[s[i]]++; mp[t[i]]++; } for (int i = 0; i < n; i++) { if (mp[s[i]] > 1 && mp[t[i]] > 1) { cout << "No\n"; return 0; } } cout << "Yes\n"; return 0; }