結果

問題 No.499 7進数変換
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-05-04 07:57:21
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 637 bytes
コンパイル時間 2,324 ms
コンパイル使用メモリ 72,956 KB
実行使用メモリ 49,868 KB
最終ジャッジ日時 2023-10-12 06:07:32
合計ジャッジ時間 4,961 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 49 ms
49,312 KB
testcase_02 AC 46 ms
49,296 KB
testcase_03 AC 47 ms
49,312 KB
testcase_04 AC 46 ms
49,172 KB
testcase_05 AC 47 ms
49,324 KB
testcase_06 AC 47 ms
49,208 KB
testcase_07 AC 48 ms
49,604 KB
testcase_08 AC 49 ms
49,108 KB
testcase_09 AC 46 ms
47,268 KB
testcase_10 AC 46 ms
49,324 KB
testcase_11 AC 46 ms
49,332 KB
testcase_12 AC 46 ms
49,312 KB
testcase_13 AC 45 ms
49,480 KB
testcase_14 AC 42 ms
49,268 KB
testcase_15 AC 42 ms
49,188 KB
testcase_16 AC 42 ms
49,264 KB
testcase_17 AC 42 ms
49,216 KB
testcase_18 AC 47 ms
47,732 KB
testcase_19 AC 42 ms
49,160 KB
testcase_20 AC 42 ms
49,324 KB
testcase_21 AC 42 ms
49,136 KB
testcase_22 AC 42 ms
49,396 KB
testcase_23 AC 42 ms
49,868 KB
testcase_24 AC 42 ms
49,372 KB
testcase_25 AC 41 ms
49,220 KB
testcase_26 AC 42 ms
49,152 KB
testcase_27 AC 42 ms
49,392 KB
testcase_28 AC 46 ms
49,624 KB
testcase_29 AC 47 ms
49,108 KB
testcase_30 AC 48 ms
49,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import static java.lang.System.in;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        long N = Long.parseLong(reader.readLine());
        System.out.println(toSeptenaryString(N));
    }

    private static String toSeptenaryString(long l) {
        StringBuilder s = new StringBuilder();
        while (l != 0) {
            s.append(l % 7);
            l = l / 7;
        }
        return s.reverse().toString();
    }
}
0