結果
問題 |
No.3196 Unique Nickname
|
ユーザー |
![]() |
提出日時 | 2025-07-13 00:08:36 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 585 bytes |
コンパイル時間 | 4,207 ms |
コンパイル使用メモリ | 283,268 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2025-07-13 00:08:41 |
合計ジャッジ時間 | 4,541 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); int n; cin >> n; vector<pair<string, string>> v(n); for (auto& [a, b] : v) cin >> a >> b; map<string, int> st; for (auto& [a, b] : v) st[a]++, st[b]++; bool ok = true; for (auto& [a, b] : v) ok &= st[a] == 1 || st[b] == 1; cout << (ok ? "Yes" : "No") << '\n'; return 0; }