結果
| 問題 |
No.2087 基数の変換
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-09-30 21:45:55 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 2,000 ms |
| コード長 | 623 bytes |
| コンパイル時間 | 2,857 ms |
| コンパイル使用メモリ | 159,620 KB |
| 最終ジャッジ日時 | 2025-02-07 19:21:00 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 51 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <iomanip>
#include <cstring>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < int(n);i++)
int main(){
int n,m;
cin >> n >> m;
string ans;
while(m > 0){
int d = m%n;
ans += char('0'+d);
m/=n;
}
if (ans == "") {
cout << 0 << endl;
return 0;
}
reverse(ans.begin(),ans.end());
cout << ans << endl;
return 0;
}