結果

問題 No.3798 algo to goal
ユーザー よには
提出日時 2026-11-13 23:01:17
言語 C++23
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 5,422 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 5,112 ms
コンパイル使用メモリ 383,420 KB
実行使用メモリ 9,928 KB
最終ジャッジ日時 2026-11-13 23:01:36
合計ジャッジ時間 9,552 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10 WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#if !__INCLUDE_LEVEL__
#include __FILE__

// using mint = modint;

void solve(){
  string s, t; cin >> s >> t;
  string s0, s1, t0, t1;
  rep(i, s.size()) (i % 2 ? s1 : s0) += s.at(i);
  rep(i, t.size()) (i % 2 ? t1 : t0) += t.at(i);
  sort(all(s0)); sort(all(s1)); sort(all(t0)); sort(all(t1));
  outln(s0 == t0 && s1 == t1 ? "Yes" : "No");
}

/*
偶奇は変わらない
他は好き放題できるかというと、分からない…
*/

signed main(){
  ios::sync_with_stdio(false); cin.tie(nullptr);
  out(fixed); out(setprecision(15));
  err(fixed); err(setprecision(15));

  int t = 1;
  cin >> t;
  while(t--) solve();
}

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

#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
// ----------ACL用----------
// __has_include("atcoder/all")環境下に置く
// ----------入力----------
template <signed MOD>
istream& operator>>(istream& is, static_modint<MOD>& x) {
  signed w;
  is >> w;
  x = w;
  return is;
}
template <signed ID>
istream& operator>>(istream& is, dynamic_modint<ID>& x) {
  signed w;
  is >> w;
  x = w;
  return is;
}

// ----------出力----------
template <signed MOD>
ostream& operator<<(ostream& os, static_modint<MOD>& x) {
  return os << x.val();
}
template <signed ID>
ostream& operator<<(ostream& os, dynamic_modint<ID>& x) {
  return os << x.val();
}
// ----------ACL用ここまで----------
#endif // atdoder/all

// ----------bits/stdc++.h用----------
// yoniha/all.hがない環境下に置く
// ----------マクロ、便利関数----------
#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;
}
template <typename T, class... Args>
void sort(vector<T>& a, Args&&... args) { sort(all(a), args...); }
template <typename T>
void reverse(vector<T>& a) { reverse(all(a)); }
template <typename T>
void unique_erase(vector<T>& a) { a.erase(unique(all(a)), a.end()); }
template <typename T>
auto min_element(vector<T>& a, auto&& comp = less()) { return min_element(all(a), comp); }
template <typename T>
auto max_element(vector<T>& a, auto&& comp = less()) { return max_element(all(a), comp); }
template <typename T, class... Args>
auto lower_bound(vector<T>& a, Args&&... args) { return lower_bound(all(a), args...); }
template <typename T, class... Args>
auto upper_bound(vector<T>& a, Args&&... args) { return upper_bound(all(a), args...); }
template <typename T, class... Args>
auto binary_search(vector<T>& a, Args&&... args) { return binary_search(all(a), args...); }
template <typename T>
auto next_permutation(vector<T>& a) { return next_permutation(all(a)); }
template <typename T, class... Args>
auto reduce(vector<T>& a, Args&&... args) { return reduce(all(a), args...); }

// ----------定数やusing----------
template <typename T>
using Dijk = priority_queue<T, vector<T>, greater<>>;
constexpr array<pair<int, int>, 4> dij{{{-1, 0}, {0, -1}, {1, 0}, {0, 1}}}; // 上から半時計周り
constexpr int inf = 1ll << 60;

// ----------ライブラリ----------


// ----------入力----------
istream& operator>>(istream& is, __int128_t& x) {
  int w;
  is >> w;
  assert(is);
  x = w;
  return is;
}
template <class T1, class T2>
istream& operator>>(istream& is, pair<T1, T2>& p) {
  auto&& [p1, p2] = p;
  is >> p1 >> p2;
  return is;
}
template <class... Ts>
istream& operator>>(istream& is, tuple<Ts...>& t) {
  apply([&](auto&... xs) { ((is >> xs), ...); }, t);
  return is;
}
template <class T>
istream& operator>>(istream& is, vector<T>& v) {
  for(auto&& x : v) is >> x;
  return is;
}
template <class... Args>
void in(Args&&... args) {
  ((cin >> args), ...);
}

// ----------出力----------
ostream& operator<<(ostream& os, __int128_t& x) {
  if(x == 0) return os << '0';
  if(x < 0) os << '-';
  string s;
  __int128_t w = x < 0 ? -x : x;
  while(w > 0) {
    s += char(w % 10 + '0');
    w /= 10;
  }
  reverse(all(s));
  return os << s;
}
template <class T1, class T2>
ostream& operator<<(ostream& os, pair<T1, T2>& p) {
  auto&& [p1, p2] = p;
  return os << p1 << ' ' << p2;
}
template <class... Ts>
ostream& operator<<(ostream& os, tuple<Ts...>& t) {
  apply([&](auto&... xs) { ((os << xs), ...); }, t);
  return os;
}
template <class T>
ostream& operator<<(ostream& os, vector<T>& v) {
  for(size_t i = 0; i < v.size(); i++) os << v[i] << (i + 1 == v.size() ? "" : " ");
  return os;
}
void out() {} // 引数なしは何もしない(outln()がバグるのを防ぐ)
template <class T, class... Args>
void out(T&& first, Args&&... args) {
  cout << first;
  ((cout << ' ' << args), ...);
}
template <class... Args>
void outln(Args&&... args) {
  out(args...);
  cout << '\n';
}
void err() {} // 引数なしは何もしない(errln()がバグるのを防ぐ)
template <class T, class... Args>
void err(T&& first, Args&&... args) {
  cerr << first;
  ((cerr << ' ' << args), ...);
}
template <class... Args>
void errln(Args&&... args) {
  err(args...);
  cerr << '\n';
}

#endif // yoniha/all.h
#endif // __INCLUDE_LEVEL__
0