結果
| 問題 | No.3623 2-Letter Shiritori 2 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-14 21:38:44 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 369µs | |
| コード長 | 546 bytes |
| 記録 | |
| コンパイル時間 | 2,039 ms |
| コンパイル使用メモリ | 339,252 KB |
| 実行使用メモリ | 7,336 KB |
| 最終ジャッジ日時 | 2026-08-14 21:38:48 |
| 合計ジャッジ時間 | 2,990 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
array<array<bool,26>,26> B{};
vector<string> ans;
auto dfs = [&](auto&& dfs, int v) -> void {
for (int to = 0; to < 26; to++) {
if (B[v][to]) continue;
B[v][to] = true;
dfs(dfs, to);
ans.push_back(string(1, v + 'A') + string(1, 'A' + to));
}
};
dfs(dfs, 0);
reverse(ans.begin(), ans.end());
for (const string& s : ans) cout << s << '\n';
}