結果

問題 No.2087 基数の変換
ユーザー shojin_proshojin_pro
提出日時 2022-09-30 21:30:19
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 485 bytes
コンパイル時間 1,990 ms
コンパイル使用メモリ 72,052 KB
実行使用メモリ 56,624 KB
最終ジャッジ日時 2023-08-24 14:48:02
合計ジャッジ時間 10,013 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
54,436 KB
testcase_01 AC 119 ms
55,820 KB
testcase_02 AC 121 ms
56,472 KB
testcase_03 AC 121 ms
55,812 KB
testcase_04 AC 120 ms
56,052 KB
testcase_05 AC 121 ms
55,900 KB
testcase_06 AC 120 ms
56,048 KB
testcase_07 AC 120 ms
56,044 KB
testcase_08 AC 120 ms
55,492 KB
testcase_09 AC 119 ms
55,716 KB
testcase_10 AC 119 ms
56,060 KB
testcase_11 AC 120 ms
55,824 KB
testcase_12 AC 120 ms
55,988 KB
testcase_13 AC 119 ms
56,000 KB
testcase_14 AC 120 ms
55,968 KB
testcase_15 AC 121 ms
55,996 KB
testcase_16 AC 121 ms
56,000 KB
testcase_17 AC 121 ms
56,540 KB
testcase_18 AC 120 ms
55,468 KB
testcase_19 AC 122 ms
56,044 KB
testcase_20 AC 120 ms
55,876 KB
testcase_21 AC 122 ms
56,048 KB
testcase_22 AC 121 ms
55,872 KB
testcase_23 AC 119 ms
55,528 KB
testcase_24 AC 121 ms
56,624 KB
testcase_25 AC 120 ms
55,812 KB
testcase_26 AC 120 ms
56,576 KB
testcase_27 AC 119 ms
55,956 KB
testcase_28 AC 120 ms
56,380 KB
testcase_29 AC 120 ms
56,136 KB
testcase_30 AC 120 ms
55,732 KB
testcase_31 AC 120 ms
55,688 KB
testcase_32 AC 120 ms
55,768 KB
testcase_33 AC 120 ms
55,564 KB
testcase_34 AC 120 ms
53,540 KB
testcase_35 AC 120 ms
55,832 KB
testcase_36 AC 121 ms
56,416 KB
testcase_37 AC 119 ms
55,968 KB
testcase_38 AC 120 ms
56,040 KB
testcase_39 AC 120 ms
56,156 KB
testcase_40 AC 120 ms
56,212 KB
testcase_41 AC 120 ms
55,864 KB
testcase_42 AC 120 ms
55,784 KB
testcase_43 AC 120 ms
56,160 KB
testcase_44 AC 120 ms
56,048 KB
testcase_45 AC 120 ms
55,796 KB
testcase_46 AC 120 ms
56,112 KB
testcase_47 AC 122 ms
55,728 KB
testcase_48 AC 120 ms
56,228 KB
testcase_49 AC 120 ms
56,004 KB
testcase_50 AC 120 ms
55,508 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int b = sc.nextInt();
        int m = sc.nextInt();
        StringBuilder sb = new StringBuilder();
        if(m > 0){
            while(m > 0){
                sb.append(m % b);
                m /= b;
            }
        }else{
            sb.append(0);
        }
        System.out.println(sb.reverse().toString());
    }
}
0