結果

問題 No.499 7進数変換
ユーザー samplelpmassamplelpmas
提出日時 2017-04-09 19:39:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 1,000 ms
コード長 420 bytes
コンパイル時間 2,262 ms
コンパイル使用メモリ 71,228 KB
実行使用メモリ 56,536 KB
最終ジャッジ日時 2023-09-25 01:29:35
合計ジャッジ時間 7,185 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,500 KB
testcase_01 AC 118 ms
56,144 KB
testcase_02 AC 120 ms
56,144 KB
testcase_03 AC 120 ms
56,332 KB
testcase_04 AC 123 ms
55,700 KB
testcase_05 AC 122 ms
55,720 KB
testcase_06 AC 121 ms
55,884 KB
testcase_07 AC 122 ms
56,324 KB
testcase_08 AC 120 ms
55,980 KB
testcase_09 AC 120 ms
56,332 KB
testcase_10 AC 124 ms
55,840 KB
testcase_11 AC 123 ms
56,020 KB
testcase_12 AC 120 ms
55,960 KB
testcase_13 AC 119 ms
56,120 KB
testcase_14 AC 120 ms
56,168 KB
testcase_15 AC 122 ms
56,108 KB
testcase_16 AC 121 ms
56,248 KB
testcase_17 AC 123 ms
55,892 KB
testcase_18 AC 124 ms
56,048 KB
testcase_19 AC 123 ms
56,072 KB
testcase_20 AC 120 ms
55,704 KB
testcase_21 AC 122 ms
56,096 KB
testcase_22 AC 123 ms
55,660 KB
testcase_23 AC 122 ms
55,740 KB
testcase_24 AC 121 ms
56,156 KB
testcase_25 AC 121 ms
55,792 KB
testcase_26 AC 122 ms
55,996 KB
testcase_27 AC 121 ms
55,940 KB
testcase_28 AC 122 ms
55,956 KB
testcase_29 AC 121 ms
56,536 KB
testcase_30 AC 120 ms
55,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int decimal = sc.nextInt();
        long septenary = 0;
        long place = 1;

        while (decimal > 0) {

            septenary += (decimal % 7) * place;
            decimal /= 7;
            place *= 10;

        }

        System.out.println(septenary);

    }

}
0