結果

問題 No.3196 Unique Nickname
ユーザー よには
提出日時 2025-07-11 21:33:44
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 993 bytes
コンパイル時間 5,206 ms
コンパイル使用メモリ 335,036 KB
実行使用メモリ 7,976 KB
最終ジャッジ日時 2025-07-11 21:34:01
合計ジャッジ時間 5,936 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#if __has_include(<yoniha/all.h>)
#include <yoniha/all.h>
using namespace atcoder;
#else
#include <bits/stdc++.h>
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
#endif
using namespace std;

#define int long long
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = (int)(n - 1); i >= 0; i--)
template <typename T> bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template <typename T> bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}

// using mint = modint;

signed main(){
  int n; cin >> n;
  vector<string> s(n), t(n);
  for(auto&& si : s) cin >> si;
  for(auto&& ti : t) cin >> ti;
  bool ans = true;
  rep(i, n){
  	bool f = true, g = true;
  	rep(j, n) if(i != j){
  	  f &= s.at(i) != s.at(j) && s.at(i) != t.at(j);
  	  g &= t.at(i) != s.at(j) && t.at(i) != t.at(j);
  	}
  	ans &= f || g;
  }
  cout << (ans ? "Yes" : "No") << '\n';
}
0