結果

問題 No.3196 Unique Nickname
ユーザー ruase_
提出日時 2025-08-14 19:51:55
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 518 bytes
コンパイル時間 1,684 ms
コンパイル使用メモリ 93,812 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2025-08-14 19:51:58
合計ジャッジ時間 2,031 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;

int main() {
	int n;
	cin >> n;
	string a[n][2];

	for(int i = 0; i < n; i++) cin>> a[i][0] >> a[i][1];

	
	string t1 = a[0][0];
	string t2 = a[0][1];
	bool t1_flg = false;
	bool t2_flg = false;
	

	for(int i = 1 ; i < n ; i++)
	{
		if(t1 == a[i][0] || t1 == a[i][1])
		{
			t1_flg = true;
		}
		if(t2 == a[i][0] || t2 == a[i][1])
		{
			t2_flg = true;
		}
	}
	
	if (t1_flg && t2_flg)
	{
		cout << "No" << endl;
	}
	else
	{
		cout << "Yes" << endl;
	}

}
0