結果
| 問題 |
No.3196 Unique Nickname
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-07-11 21:37:47 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 466 bytes |
| コンパイル時間 | 3,474 ms |
| コンパイル使用メモリ | 286,744 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-07-11 21:37:54 |
| 合計ジャッジ時間 | 4,179 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<pair<string, string>> V;
map<string, int> cnt;
for (int i = 0; i < N; i++) {
string S, T;
cin >> S >> T;
V.emplace_back(S, T);
cnt[S]++, cnt[T]++;
}
bool ok = true;
for (int i = 0; i < N; i++) {
ok &= cnt[V[i].first] == 1 || cnt[V[i].second] == 1;
}
cout << (ok ? "Yes": "No") << endl;
return 0;
}