結果

問題 No.2234 palindromer
ユーザー jianglyjiangly
提出日時 2023-03-03 21:36:10
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 470 bytes
コンパイル時間 2,197 ms
コンパイル使用メモリ 202,728 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-17 22:29:09
合計ジャッジ時間 2,859 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using i64 = long long;

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    std::string A;
    std::cin >> A;
    
    for (int n = A.size(); ; n++) {
        std::string S = A;
        S += std::string(A.rend() - (n - A.size()), A.rend());
        auto T = std::string(S.rbegin(), S.rend());
        if (S == T) {
            std::cout << S << "\n";
            return 0;
        }
    }
    
    return 0;
}
0