結果

問題 No.327 アルファベット列
ユーザー spaciaspacia
提出日時 2016-06-08 17:20:00
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 563 bytes
コンパイル時間 2,145 ms
コンパイル使用メモリ 76,596 KB
実行使用メモリ 56,036 KB
最終ジャッジ日時 2024-04-17 09:49:48
合計ジャッジ時間 9,864 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
52,640 KB
testcase_01 AC 112 ms
52,852 KB
testcase_02 AC 125 ms
54,092 KB
testcase_03 AC 119 ms
54,116 KB
testcase_04 AC 122 ms
54,220 KB
testcase_05 AC 117 ms
54,156 KB
testcase_06 AC 115 ms
54,140 KB
testcase_07 AC 114 ms
53,000 KB
testcase_08 AC 119 ms
54,264 KB
testcase_09 AC 123 ms
53,876 KB
testcase_10 AC 121 ms
54,116 KB
testcase_11 AC 116 ms
54,132 KB
testcase_12 AC 109 ms
52,724 KB
testcase_13 AC 118 ms
54,016 KB
testcase_14 AC 122 ms
53,780 KB
testcase_15 AC 115 ms
52,752 KB
testcase_16 AC 124 ms
54,072 KB
testcase_17 AC 130 ms
53,900 KB
testcase_18 AC 113 ms
52,712 KB
testcase_19 AC 112 ms
52,828 KB
testcase_20 AC 125 ms
53,856 KB
testcase_21 AC 119 ms
54,176 KB
testcase_22 AC 113 ms
53,504 KB
testcase_23 AC 107 ms
53,012 KB
testcase_24 AC 115 ms
52,964 KB
testcase_25 AC 113 ms
52,904 KB
testcase_26 AC 126 ms
54,052 KB
testcase_27 AC 121 ms
53,972 KB
testcase_28 AC 122 ms
54,156 KB
testcase_29 AC 119 ms
53,984 KB
testcase_30 AC 118 ms
54,284 KB
testcase_31 AC 124 ms
53,784 KB
testcase_32 AC 122 ms
53,696 KB
testcase_33 AC 126 ms
54,004 KB
testcase_34 AC 127 ms
54,028 KB
testcase_35 AC 127 ms
54,224 KB
testcase_36 AC 125 ms
53,892 KB
testcase_37 AC 123 ms
54,236 KB
testcase_38 AC 127 ms
54,156 KB
testcase_39 AC 125 ms
53,880 KB
testcase_40 AC 125 ms
53,888 KB
testcase_41 AC 129 ms
54,084 KB
testcase_42 AC 118 ms
52,784 KB
testcase_43 AC 123 ms
54,204 KB
testcase_44 AC 110 ms
52,720 KB
testcase_45 AC 109 ms
52,900 KB
testcase_46 AC 121 ms
54,180 KB
testcase_47 AC 121 ms
56,036 KB
testcase_48 AC 126 ms
54,100 KB
testcase_49 AC 127 ms
54,068 KB
testcase_50 AC 127 ms
54,128 KB
testcase_51 AC 125 ms
54,036 KB
testcase_52 AC 123 ms
54,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main (String[] args) {

		Scanner sc = new Scanner(System.in);

		System.out.println(solve(sc.nextLong()));

		sc.close();

	}

	public static String solve (long n) {

		String[] alp = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
		String ret = alp[(int)(n % 26)];

		long d = 26;
		while (n / d >= 1) {
			int i = (int)(n / d % 26) - 1;
			if (i == -1) i = 25;
			ret = alp[i] + ret;
			n -= d;
			d *= 26;
		}

		return ret;

	}

}
0