結果

問題 No.2087 基数の変換
ユーザー nystnyst
提出日時 2022-09-30 22:28:45
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 921 ms
コンパイル使用メモリ 77,240 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-23 00:13:49
合計ジャッジ時間 2,191 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 51
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <iomanip>
#include <algorithm>
using namespace std;

const int initv = 100001;

int main(){
    int n,m;
    cin >> n >> m;

    if(m==0){
        cout << 0 << endl;
        return 0;
    }
    vector<int> ans;
    while(0<m){
        ans.push_back(m%n);
        m/=n;
    }
    reverse(ans.begin(),ans.end());

    for(auto x:ans) cout << x;
    cout << endl;
}
0