結果

問題 No.238 Mr. K's Another Gift
ユーザー syoken_desukasyoken_desuka
提出日時 2015-07-05 23:13:13
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 1,243 bytes
コンパイル時間 687 ms
コンパイル使用メモリ 84,328 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-07 23:47:33
合計ジャッジ時間 4,957 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 14 WA * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <array>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <ostream>
#include<complex>
#include <cmath>
#include <iostream>
#include <stack>
#include <fstream>
#include <queue>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <string>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;



int main()
{
    string s;
    s.resize(50000);
    cin >> s;
    //cin >> hogehoge;
    bool filled = false;
    rep(i,s.size()/2) // fill test
    {
        if (s[i] != s[s.size() - 1 - i])
        {
            s.insert(s.size()-i,s.substr(i,1));
            filled = true;
            break;
        }
    }
    if (!filled)
    {
        if (s.size() % 2 == 0)
        {
            s.insert(s.size()/2,"a");
        }
        else
        {
            s.insert(s.size()/2,s.substr(s.size()/2,1));   
        }
    }
    rep(i,s.size()/2) // check
    {
        if (s[i] != s[s.size()- 1 - i])
        {
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << s << endl;
    return 0;
}
0