結果

問題 No.3196 Unique Nickname
ユーザー The Forsaking
提出日時 2025-07-12 10:23:04
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 472 bytes
コンパイル時間 2,147 ms
コンパイル使用メモリ 201,668 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-07-12 10:23:08
合計ジャッジ時間 3,269 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef pair<int, int> pii;
typedef long long ll;
const int N = 2000086, MOD = 998244353, INF = 0x3f3f3f3f;
ll res;
int n, m, cnt, w[N];


string s[200], t[200];
int main() {
	cin >> n;
	map<string, int> ma;
	for (int i = 1; i < n + 1; i++) {
		cin >> s[i] >> t[i];
		ma[s[i]]++, ma[t[i]]++;
	}
	for (int i = 1; i < n + 1; i++)
		if (ma[s[i]] > 1 && ma[t[i]] > 1) {
			puts("No");
			return 0;
		}
	puts("Yes");
	return 0;
}
0