結果
問題 |
No.3109 Swap members
|
ユーザー |
![]() |
提出日時 | 2025-04-23 00:13:34 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 68 ms / 2,000 ms |
コード長 | 708 bytes |
コンパイル時間 | 3,974 ms |
コンパイル使用メモリ | 290,792 KB |
実行使用メモリ | 21,504 KB |
最終ジャッジ日時 | 2025-04-23 00:13:48 |
合計ジャッジ時間 | 12,784 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 52 |
ソースコード
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); int n, k; cin >> n >> k; vector<vector<string>> s(k), t(k); rep(i, n) { string x; cin >> x; s[i % k].push_back(x); } rep(i, n) { string x; cin >> x; t[i % k].push_back(x); } rep(i, k) { sort(s[i].begin(), s[i].end()); sort(t[i].begin(), t[i].end()); if (s[i] != t[i]) { cout << "No" << endl; return 0; } } cout << "Yes" << endl; return 0; }