結果

問題 No.3196 Unique Nickname
ユーザー Andrew8128
提出日時 2025-07-11 21:26:48
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,122 bytes
コンパイル時間 946 ms
コンパイル使用メモリ 104,700 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-07-11 21:26:50
合計ジャッジ時間 1,499 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using std::cerr, std::cin, std::cout, std::endl, std::fixed, std::flush;
#include <vector>
using std::vector;
#include <string>
using std::stoi, std::stol, std::string, std::to_string;
#include <algorithm>
using std::clamp, std::ranges::count, std::ranges::count_if, std::ranges::fill, std::ranges::find, std::ranges::find_if, std::ranges::is_permutation;
using std::ranges::lower_bound, std::ranges::max, std::ranges::max_element, std::ranges::min, std::ranges::min_element, std::ranges::next_permutation;
using std::ranges::prev_permutation, std::ranges::reverse, std::ranges::rotate, std::ranges::sort, std::ranges::unique, std::ranges::upper_bound;
static_assert(sizeof(long) == 8);
int main()
{
  int N;
  cin >> N;
  vector<string> S(N), T(N);
  for (int i = 0; i < N; i++)
  {
    cin >> S[i] >> T[i];
  }
  for (int i = 0; i < N; i++)
  {
    if (count(S, S[i]) + count(T, S[i]) > 1 && count(S, T[i]) + count(T, T[i]) > 1)
    {
      cout << "No\n";
      return 0;
    }
  }
  cout << "Yes\n";
  return 0;
}
/*
  File : ~/kyopro/yukicoder/554/3196.cpp
  Date : 2025/07/11
  Time : 21:22:53
*/
0