結果
| 問題 | No.2234 palindromer | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2023-03-03 21:36:10 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 470 bytes | 
| コンパイル時間 | 2,179 ms | 
| コンパイル使用メモリ | 196,060 KB | 
| 最終ジャッジ日時 | 2025-02-11 02:01:36 | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 13 | 
ソースコード
#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;
}
            
            
            
        