結果

問題 No.499 7進数変換
ユーザー tentententen
提出日時 2020-09-10 10:05:46
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 316 bytes
コンパイル時間 2,425 ms
コンパイル使用メモリ 72,348 KB
実行使用メモリ 56,180 KB
最終ジャッジ日時 2023-08-23 13:06:55
合計ジャッジ時間 7,403 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 123 ms
56,180 KB
testcase_02 AC 122 ms
53,720 KB
testcase_03 AC 124 ms
55,560 KB
testcase_04 AC 125 ms
55,660 KB
testcase_05 AC 124 ms
55,664 KB
testcase_06 AC 123 ms
55,428 KB
testcase_07 AC 122 ms
55,812 KB
testcase_08 AC 122 ms
55,752 KB
testcase_09 AC 123 ms
55,816 KB
testcase_10 AC 125 ms
55,752 KB
testcase_11 AC 126 ms
55,876 KB
testcase_12 AC 123 ms
56,076 KB
testcase_13 AC 124 ms
55,724 KB
testcase_14 AC 124 ms
55,720 KB
testcase_15 AC 125 ms
55,868 KB
testcase_16 AC 124 ms
55,876 KB
testcase_17 AC 125 ms
56,064 KB
testcase_18 AC 124 ms
56,040 KB
testcase_19 AC 124 ms
55,936 KB
testcase_20 AC 122 ms
55,876 KB
testcase_21 AC 122 ms
55,904 KB
testcase_22 AC 124 ms
55,792 KB
testcase_23 AC 125 ms
55,848 KB
testcase_24 AC 123 ms
55,948 KB
testcase_25 AC 126 ms
56,056 KB
testcase_26 AC 121 ms
55,756 KB
testcase_27 AC 122 ms
56,036 KB
testcase_28 AC 123 ms
55,916 KB
testcase_29 AC 122 ms
55,844 KB
testcase_30 AC 123 ms
55,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int n = sc.nextInt();
    	StringBuilder sb = new StringBuilder();
    	while (n > 0) {
    	    sb.append(n % 7);
    	    n /= 7;
    	}
    	System.out.println(sb.reverse());
    }
}
0