結果

問題 No.600 かい文回
コンテスト
ユーザー mamekin
提出日時 2017-11-25 20:35:33
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 891 bytes
コンパイル時間 868 ms
コンパイル使用メモリ 102,384 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-27 10:07:15
合計ジャッジ時間 1,813 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
using namespace std;

int main()
{
    int n;
    cin >> n;
    bitset<32> bs(n);

    int i = 31;
    while(!bs[i])
        -- i;

    char c = 'a';
    string s;
    for(--i; i>=0; --i){
        s += c;
        if(bs[i]){
            if(c == 'z')
                c = 'a';
            else
                ++ c;
            s += c;
        }
    }

    string ans = s;
    reverse(ans.begin(), ans.end());
    ans += s;
    cout << ans << endl;

    return 0;
}
0