結果

問題 No.2087 基数の変換
コンテスト
ユーザー shkiiii_
提出日時 2022-09-30 21:25:03
言語 C++14
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 364µs
コード長 641 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 954 ms
コンパイル使用メモリ 186,208 KB
実行使用メモリ 9,920 KB
最終ジャッジ日時 2026-10-06 04:44:34
合計ジャッジ時間 3,563 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 51
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<bits/stdc++.h>
// #include<atcoder/all>
// #include<boost/multiprecision/cpp_int.hpp>

using namespace std;
// using namespace atcoder;
// using bint = boost::multiprecision::cpp_int;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007
// #define MOD 998244353


int main(){
  
  ll n,m;
  cin >> n >> m;
  vector<int> res;
  while(m){
    res.push_back(m%n);
    m /= n;
  }
  if(res.empty())res.push_back(0);
  reverse(ALL(res));
  rep(i,res.size())cout << res[i];
  cout << "\n";
  

  return 0;
}
0