結果
| 問題 | No.3196 Unique Nickname |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-08-14 18:12:28 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 673µs | |
| コード長 | 705 bytes |
| 記録 | |
| コンパイル時間 | 891 ms |
| コンパイル使用メモリ | 149,304 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-14 00:19:00 |
| 合計ジャッジ時間 | 2,268 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <iostream>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
string s[n], t[n];
for (int i = 0; i < n; i++) {
cin >> s[i] >> t[i];
}
bool ans = true;
for (int i = 0; i < n; i++) {
bool fs = true, ft = true;
for (int j = 0; j < n; j++) {
if (i == j) {
continue;
}
if (s[i] == s[j] || s[i] == t[j]) {
fs = false;
}
if (t[i] == s[j] || t[i] == t[j]) {
ft = false;
}
}
if (!fs && !ft) {
ans = false;
}
}
cout << (ans ? "Yes" : "No") << endl;
return 0;
}