結果

問題 No.600 かい文回
ユーザー xuzijian629xuzijian629
提出日時 2018-09-14 14:56:35
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,315 bytes
コンパイル時間 929 ms
コンパイル使用メモリ 104,044 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-18 15:03:11
合計ジャッジ時間 2,366 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 WA -
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <chrono>
#include <random>
#include <bitset>
#include <iterator>
#include <functional>
#include <utility>
#include <cassert>
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma comment(linker, "STACK:36777216")
using namespace std;
using i64 = int64_t;
using i128 = __int128_t;
constexpr i64 MOD = 1e9 + 7;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
using vi = vector<i64>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using ii = pair<i64, i64>;

int main() {
    int n;
    cin >> n;
    deque<char> ans = {'a'};
    string b = "";
    while (n) {
        b += '0' + (n & 1);
        n >>= 1;
    }
    reverse(b.begin(), b.end());
    for (int i = 0; i < b.size(); i++) {
        if (i != 0 && b[i] == '1') {
            ans.push_front(ans.front() + 1);
            ans.push_back(ans.back() + 1);
        }
        if (i != b.size() - 1) {
            ans.push_front(ans.front());
            ans.push_back(ans.back());
        }
    }
    for (int i = 0; i < ans.size() - 1; i++) {
        cout << ans[i];
    }
    cout << ans.back() << endl;
}
0