結果

問題 No.499 7進数変換
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2017-04-07 22:33:14
言語 Java19
(openjdk 21)
結果
AC  
実行時間 129 ms / 1,000 ms
コード長 431 bytes
コンパイル時間 2,183 ms
コンパイル使用メモリ 73,376 KB
実行使用メモリ 56,640 KB
最終ジャッジ日時 2023-09-23 00:30:21
合計ジャッジ時間 7,445 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
56,096 KB
testcase_01 AC 125 ms
55,840 KB
testcase_02 AC 124 ms
55,708 KB
testcase_03 AC 123 ms
55,944 KB
testcase_04 AC 122 ms
56,060 KB
testcase_05 AC 123 ms
55,708 KB
testcase_06 AC 124 ms
56,132 KB
testcase_07 AC 125 ms
55,960 KB
testcase_08 AC 124 ms
55,688 KB
testcase_09 AC 128 ms
55,536 KB
testcase_10 AC 123 ms
56,004 KB
testcase_11 AC 125 ms
55,664 KB
testcase_12 AC 125 ms
55,776 KB
testcase_13 AC 125 ms
55,616 KB
testcase_14 AC 125 ms
55,812 KB
testcase_15 AC 124 ms
56,640 KB
testcase_16 AC 126 ms
55,992 KB
testcase_17 AC 126 ms
56,068 KB
testcase_18 AC 125 ms
56,172 KB
testcase_19 AC 125 ms
55,768 KB
testcase_20 AC 124 ms
55,772 KB
testcase_21 AC 128 ms
55,972 KB
testcase_22 AC 125 ms
55,924 KB
testcase_23 AC 125 ms
55,580 KB
testcase_24 AC 124 ms
55,796 KB
testcase_25 AC 123 ms
55,936 KB
testcase_26 AC 126 ms
56,052 KB
testcase_27 AC 127 ms
56,056 KB
testcase_28 AC 124 ms
55,972 KB
testcase_29 AC 126 ms
56,148 KB
testcase_30 AC 129 ms
55,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        ArrayList<Integer> L = new ArrayList<>();
        while(true){
            L.add(N%7);
            N/=7;
            if(N==0)break;
        }
        for(int i=L.size()-1; i>=0; i--){
            System.out.print(L.get(i));
        }System.out.println();
    }
}
0