結果

問題 No.327 アルファベット列
ユーザー htensaihtensai
提出日時 2019-11-22 18:57:28
言語 Java21
(openjdk 21)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 380 bytes
コンパイル時間 2,182 ms
コンパイル使用メモリ 74,204 KB
実行使用メモリ 54,464 KB
最終ジャッジ日時 2024-10-11 02:38:53
合計ジャッジ時間 10,969 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
53,932 KB
testcase_01 AC 136 ms
53,688 KB
testcase_02 AC 138 ms
54,052 KB
testcase_03 AC 136 ms
54,256 KB
testcase_04 AC 134 ms
53,880 KB
testcase_05 AC 136 ms
53,968 KB
testcase_06 AC 134 ms
53,940 KB
testcase_07 AC 134 ms
53,836 KB
testcase_08 AC 135 ms
54,240 KB
testcase_09 AC 136 ms
54,272 KB
testcase_10 AC 133 ms
54,124 KB
testcase_11 AC 135 ms
54,100 KB
testcase_12 AC 138 ms
53,928 KB
testcase_13 AC 136 ms
54,012 KB
testcase_14 AC 136 ms
53,812 KB
testcase_15 AC 136 ms
53,860 KB
testcase_16 AC 138 ms
54,044 KB
testcase_17 AC 138 ms
54,108 KB
testcase_18 AC 123 ms
52,832 KB
testcase_19 AC 139 ms
53,776 KB
testcase_20 AC 138 ms
54,200 KB
testcase_21 AC 140 ms
53,748 KB
testcase_22 AC 137 ms
54,068 KB
testcase_23 AC 134 ms
53,760 KB
testcase_24 AC 136 ms
53,980 KB
testcase_25 AC 138 ms
53,992 KB
testcase_26 AC 136 ms
53,924 KB
testcase_27 AC 143 ms
54,148 KB
testcase_28 AC 137 ms
53,928 KB
testcase_29 AC 137 ms
54,060 KB
testcase_30 AC 137 ms
54,028 KB
testcase_31 AC 143 ms
54,076 KB
testcase_32 AC 141 ms
53,980 KB
testcase_33 AC 137 ms
54,024 KB
testcase_34 AC 136 ms
53,772 KB
testcase_35 AC 136 ms
54,068 KB
testcase_36 AC 136 ms
54,028 KB
testcase_37 AC 136 ms
54,216 KB
testcase_38 AC 138 ms
53,984 KB
testcase_39 AC 138 ms
53,740 KB
testcase_40 AC 136 ms
53,696 KB
testcase_41 AC 137 ms
54,008 KB
testcase_42 AC 134 ms
53,932 KB
testcase_43 AC 137 ms
53,992 KB
testcase_44 AC 136 ms
53,796 KB
testcase_45 AC 137 ms
54,184 KB
testcase_46 AC 136 ms
53,944 KB
testcase_47 AC 139 ms
53,964 KB
testcase_48 AC 137 ms
53,876 KB
testcase_49 AC 136 ms
53,872 KB
testcase_50 AC 135 ms
54,152 KB
testcase_51 AC 137 ms
53,896 KB
testcase_52 AC 136 ms
54,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		StringBuilder sb = new StringBuilder();
		sb.append((char)(n % 26 + 'A'));
	    n /= 26;
		while (n > 0) {
		    n--;
		    char c = (char)(n  % 26 + 'A');
		    sb.insert(0, c);
		    n /= 26;
		}
		System.out.println(sb);
	}
}
0