結果

問題 No.2087 基数の変換
ユーザー Master wwc
提出日時 2022-10-07 11:56:05
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 465 bytes
コンパイル時間 2,640 ms
コンパイル使用メモリ 245,644 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-11 19:32:38
合計ジャッジ時間 4,018 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15 WA * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define ll long long
using namespace std;

void solve()
{
    ll n,m; cin>>n>>m;
    string ans="";
    bool ch=true;
    while(true)
    {
      if(m/n==0)
       {
          ans.push_back((char)m%n+48);
          break;
       }
       ans.push_back((char)m%n+48);
       m/=n;
    }
    reverse(ans.begin(),ans.end());
    cout<< ans << "\n";
}

signed main(){

  ios_base::sync_with_stdio(false),cin.tie(0);
  cout.tie(0);

  solve();
}
0