結果

問題 No.499 7進数変換
ユーザー GoryudyumaGoryudyuma
提出日時 2017-05-06 00:35:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 1,000 ms
コード長 680 bytes
コンパイル時間 3,619 ms
コンパイル使用メモリ 71,284 KB
実行使用メモリ 56,364 KB
最終ジャッジ日時 2023-10-12 10:49:23
合計ジャッジ時間 7,345 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,660 KB
testcase_01 AC 118 ms
55,756 KB
testcase_02 AC 118 ms
55,508 KB
testcase_03 AC 119 ms
55,832 KB
testcase_04 AC 119 ms
55,996 KB
testcase_05 AC 120 ms
55,576 KB
testcase_06 AC 119 ms
56,276 KB
testcase_07 AC 120 ms
55,840 KB
testcase_08 AC 120 ms
55,536 KB
testcase_09 AC 119 ms
56,304 KB
testcase_10 AC 119 ms
56,364 KB
testcase_11 AC 119 ms
55,760 KB
testcase_12 AC 119 ms
54,192 KB
testcase_13 AC 120 ms
56,200 KB
testcase_14 AC 118 ms
56,280 KB
testcase_15 AC 119 ms
55,576 KB
testcase_16 AC 119 ms
55,832 KB
testcase_17 AC 119 ms
55,864 KB
testcase_18 AC 118 ms
55,456 KB
testcase_19 AC 119 ms
56,092 KB
testcase_20 AC 119 ms
55,844 KB
testcase_21 AC 120 ms
55,964 KB
testcase_22 AC 120 ms
55,768 KB
testcase_23 AC 119 ms
55,860 KB
testcase_24 AC 120 ms
55,504 KB
testcase_25 AC 120 ms
56,364 KB
testcase_26 AC 120 ms
56,040 KB
testcase_27 AC 120 ms
56,048 KB
testcase_28 AC 120 ms
55,636 KB
testcase_29 AC 120 ms
55,264 KB
testcase_30 AC 121 ms
55,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main{
        public static void main(String[] args){
                try(Scanner sc = new Scanner(System.in)){
                        long N = sc.nextLong();
                        if(N==0){
                                System.out.println(0);
                                return;
                        }
                        solve(N);
                        System.out.println("");
                }
        }
        private static void solve(long N){
                if(N==0){
                        return;
                }
                solve(N/7);
                System.out.print(N%7);
                return;
        }
}
0