結果

問題 No.2087 基数の変換
ユーザー Hydrogen332
提出日時 2024-10-31 01:10:08
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 437 bytes
コンパイル時間 1,944 ms
コンパイル使用メモリ 195,464 KB
最終ジャッジ日時 2025-02-25 01:54:18
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 49 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, e) for (int i = (int)s; i < (int)e; ++i)
#define all(a) (a).begin(), (a).end()

int main() {
    cin.tie(nullptr);
    
    int N, M;
    cin >> N >> M;
    
    vector<int> res;
    while (M > 0) {
        res.push_back(M % N);
        M /= N;
    }
    
    int siz = res.size();
    
    rep(i, 0, siz) cout << res[siz - i - 1];
    cout << '\n';
}
0