結果
問題 | No.2087 基数の変換 |
ユーザー | 👑 p-adic |
提出日時 | 2022-08-13 18:51:13 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 511 bytes |
コンパイル時間 | 677 ms |
コンパイル使用メモリ | 69,400 KB |
最終ジャッジ日時 | 2025-01-30 22:19:19 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 51 |
ソースコード
#include <iostream> #include <string> #include <stdio.h> #include <stdint.h> using namespace std; using ll = long long; #define CIN( LL , A ) LL A; cin >> A #define RETURN( LL , ANSWER ) const LL answer_for_contest = ( ANSWER ); cout << answer_for_contest << endl; return 0 int main() { CIN( ll , N ); CIN( ll , M ); if( N == 10 || M == 0 ){ RETURN( ll , M ); } string answer = ""; while( M != 0 ){ answer = to_string( M % N ) + answer; M /= N; } RETURN( string , answer ); }