結果

問題 No.499 7進数変換
ユーザー oooooba
提出日時 2021-02-27 20:58:42
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 20 ms / 1,000 ms
コード長 576 bytes
コンパイル時間 989 ms
コンパイル使用メモリ 111,736 KB
最終ジャッジ日時 2025-01-19 08:05:56
ジャッジサーバーID
(参考情報)
judge2 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <optional>
#include <queue>
#include <sstream>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

int main() {
    int32_t n;
    cin >> n;
    if (n == 0) {
        cout << 0 << endl;
        return 0;
    }
    string ans;
    while (n > 0) {
        ans += char('0' + n % 7);
        n /= 7;
    }
    reverse(ans.begin(), ans.end());
    cout << ans << endl;
    return 0;
}
0