結果

問題 No.499 7進数変換
ユーザー GrenacheGrenache
提出日時 2017-04-09 10:58:36
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 1,000 ms
コード長 694 bytes
コンパイル時間 4,553 ms
コンパイル使用メモリ 74,348 KB
実行使用メモリ 56,020 KB
最終ジャッジ日時 2023-09-25 01:17:25
合計ジャッジ時間 8,894 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,912 KB
testcase_01 AC 128 ms
55,736 KB
testcase_02 AC 128 ms
56,020 KB
testcase_03 AC 127 ms
55,424 KB
testcase_04 AC 127 ms
55,784 KB
testcase_05 AC 127 ms
55,332 KB
testcase_06 AC 128 ms
55,564 KB
testcase_07 AC 129 ms
55,668 KB
testcase_08 AC 128 ms
55,640 KB
testcase_09 AC 129 ms
55,744 KB
testcase_10 AC 128 ms
55,680 KB
testcase_11 AC 128 ms
55,636 KB
testcase_12 AC 128 ms
55,556 KB
testcase_13 AC 127 ms
55,620 KB
testcase_14 AC 129 ms
55,540 KB
testcase_15 AC 128 ms
55,552 KB
testcase_16 AC 128 ms
55,376 KB
testcase_17 AC 129 ms
55,572 KB
testcase_18 AC 128 ms
55,532 KB
testcase_19 AC 128 ms
55,992 KB
testcase_20 AC 127 ms
53,524 KB
testcase_21 AC 127 ms
55,340 KB
testcase_22 AC 129 ms
55,484 KB
testcase_23 AC 128 ms
55,772 KB
testcase_24 AC 130 ms
55,900 KB
testcase_25 AC 128 ms
55,512 KB
testcase_26 AC 129 ms
55,720 KB
testcase_27 AC 129 ms
55,660 KB
testcase_28 AC 129 ms
55,628 KB
testcase_29 AC 129 ms
55,532 KB
testcase_30 AC 129 ms
55,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;


public class Main_yukicoder499 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int n = sc.nextInt();

		if (n == 0) {
			pr.println(0);
			return;
		}

		StringBuilder ret = new StringBuilder();
		while (n > 0) {
			ret.append((char)('0' + n % 7));
			n /= 7;
		}

		pr.println(ret.reverse());
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
0