結果

問題 No.3623 2-Letter Shiritori 2
コンテスト
ユーザー V_Melville
提出日時 2026-08-14 22:00:37
言語 C++23
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 255µs
コード長 658 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,878 ms
コンパイル使用メモリ 342,604 KB
実行使用メモリ 7,340 KB
最終ジャッジ日時 2026-08-14 22:00:40
合計ジャッジ時間 2,800 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)

using namespace std;
using ll = long long;

int main() {
    int n = 26;
    vector<vector<int>> to(n);
    rep(i, n)rep(j, n) {
        to[i].push_back(j);
    }
    
    vector<int> path;
    vector<int> it(n);
    auto dfs = [&](auto& f, int v) -> void {
        while (it[v] < to[v].size()) {
            int u = to[v][it[v]++];
            f(f, u);
        }
        path.push_back(v);
    };
    dfs(dfs, 0);
    
    reverse(path.begin(), path.end());
    
    rep(i, path.size()-1) {
        cout << char('A'+path[i]) << char('A'+path[i+1]) << '\n';
    }
    
    return 0;
}
0