結果
問題 |
No.2234 palindromer
|
ユーザー |
|
提出日時 | 2023-03-03 23:41:48 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 405 bytes |
コンパイル時間 | 2,049 ms |
コンパイル使用メモリ | 194,820 KB |
最終ジャッジ日時 | 2025-02-11 04:45:42 |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 4 WA * 9 |
ソースコード
#include <bits/stdc++.h> using namespace std; bool isP(string s) { string t = s; reverse(t.begin(), t.end()); return s == t; } int main () { string s; cin >> s; string r = s; reverse(r.begin(), r.end()); for (int i = 0; i < s.size(); i ++) { string t = s + r.substr(0, i); if (isP(t)) { cout << t << endl; return 0; } } }