結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
41,240 KB
testcase_01 AC 136 ms
41,372 KB
testcase_02 AC 126 ms
41,220 KB
testcase_03 AC 128 ms
41,736 KB
testcase_04 AC 134 ms
41,572 KB
testcase_05 AC 129 ms
41,308 KB
testcase_06 AC 131 ms
41,220 KB
testcase_07 AC 128 ms
41,488 KB
testcase_08 AC 128 ms
41,384 KB
testcase_09 AC 131 ms
41,564 KB
testcase_10 AC 126 ms
41,588 KB
testcase_11 AC 129 ms
41,716 KB
testcase_12 AC 130 ms
41,736 KB
testcase_13 AC 128 ms
41,404 KB
testcase_14 AC 129 ms
41,412 KB
testcase_15 AC 130 ms
41,428 KB
testcase_16 AC 115 ms
41,460 KB
testcase_17 AC 128 ms
41,544 KB
testcase_18 AC 131 ms
41,588 KB
testcase_19 AC 131 ms
41,464 KB
testcase_20 AC 117 ms
41,476 KB
testcase_21 AC 121 ms
39,912 KB
testcase_22 AC 134 ms
41,532 KB
testcase_23 AC 137 ms
41,276 KB
testcase_24 AC 132 ms
41,752 KB
testcase_25 AC 123 ms
40,164 KB
testcase_26 AC 123 ms
40,376 KB
testcase_27 AC 128 ms
41,316 KB
testcase_28 AC 130 ms
41,324 KB
testcase_29 AC 131 ms
41,596 KB
testcase_30 AC 130 ms
41,140 KB
testcase_31 AC 128 ms
41,400 KB
testcase_32 AC 127 ms
41,520 KB
testcase_33 AC 130 ms
41,480 KB
testcase_34 AC 129 ms
41,532 KB
testcase_35 AC 128 ms
41,420 KB
testcase_36 AC 132 ms
41,468 KB
testcase_37 AC 131 ms
41,580 KB
testcase_38 AC 130 ms
41,116 KB
testcase_39 AC 130 ms
41,456 KB
testcase_40 AC 132 ms
41,364 KB
testcase_41 AC 131 ms
41,344 KB
testcase_42 AC 131 ms
41,216 KB
testcase_43 AC 116 ms
41,396 KB
testcase_44 AC 129 ms
41,308 KB
testcase_45 AC 131 ms
41,960 KB
testcase_46 AC 131 ms
41,440 KB
testcase_47 AC 138 ms
41,896 KB
testcase_48 AC 116 ms
41,636 KB
testcase_49 AC 132 ms
41,544 KB
testcase_50 AC 129 ms
41,400 KB
testcase_51 AC 130 ms
41,352 KB
testcase_52 AC 131 ms
41,460 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