結果
問題 |
No.3196 Unique Nickname
|
ユーザー |
![]() |
提出日時 | 2025-08-14 19:54:40 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 518 bytes |
コンパイル時間 | 841 ms |
コンパイル使用メモリ | 96,608 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-08-14 19:54:42 |
合計ジャッジ時間 | 1,865 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 WA * 9 |
ソースコード
#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; } }