結果

問題 No.327 アルファベット列
ユーザー samplelpmassamplelpmas
提出日時 2017-05-10 09:40:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 547 bytes
コンパイル時間 2,974 ms
コンパイル使用メモリ 71,452 KB
実行使用メモリ 56,436 KB
最終ジャッジ日時 2023-10-13 09:57:51
合計ジャッジ時間 11,226 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,544 KB
testcase_01 AC 122 ms
55,940 KB
testcase_02 AC 120 ms
56,260 KB
testcase_03 AC 119 ms
56,064 KB
testcase_04 AC 118 ms
55,844 KB
testcase_05 AC 117 ms
56,112 KB
testcase_06 AC 119 ms
55,880 KB
testcase_07 AC 120 ms
56,100 KB
testcase_08 AC 120 ms
56,176 KB
testcase_09 AC 121 ms
55,852 KB
testcase_10 AC 119 ms
56,288 KB
testcase_11 AC 119 ms
55,852 KB
testcase_12 AC 120 ms
56,088 KB
testcase_13 AC 122 ms
55,884 KB
testcase_14 AC 119 ms
55,932 KB
testcase_15 AC 121 ms
55,548 KB
testcase_16 AC 122 ms
56,056 KB
testcase_17 AC 122 ms
55,864 KB
testcase_18 AC 120 ms
56,224 KB
testcase_19 AC 117 ms
55,800 KB
testcase_20 AC 126 ms
55,704 KB
testcase_21 AC 121 ms
55,848 KB
testcase_22 AC 119 ms
55,912 KB
testcase_23 AC 119 ms
56,088 KB
testcase_24 AC 118 ms
56,436 KB
testcase_25 AC 118 ms
56,216 KB
testcase_26 AC 121 ms
55,988 KB
testcase_27 AC 122 ms
55,988 KB
testcase_28 AC 124 ms
55,932 KB
testcase_29 AC 127 ms
55,668 KB
testcase_30 AC 127 ms
55,852 KB
testcase_31 AC 125 ms
55,860 KB
testcase_32 AC 120 ms
55,668 KB
testcase_33 AC 118 ms
55,696 KB
testcase_34 AC 117 ms
55,988 KB
testcase_35 AC 123 ms
55,872 KB
testcase_36 AC 118 ms
56,180 KB
testcase_37 AC 122 ms
55,572 KB
testcase_38 AC 123 ms
55,896 KB
testcase_39 AC 122 ms
55,980 KB
testcase_40 AC 124 ms
55,844 KB
testcase_41 AC 122 ms
55,904 KB
testcase_42 AC 123 ms
55,668 KB
testcase_43 AC 122 ms
55,632 KB
testcase_44 AC 123 ms
55,784 KB
testcase_45 AC 121 ms
55,664 KB
testcase_46 AC 121 ms
55,752 KB
testcase_47 AC 121 ms
55,856 KB
testcase_48 AC 119 ms
56,068 KB
testcase_49 AC 121 ms
55,740 KB
testcase_50 AC 117 ms
55,744 KB
testcase_51 AC 117 ms
56,064 KB
testcase_52 AC 121 ms
55,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        long N = sc.nextLong() + 1;

        StringBuilder LetterSequences = new StringBuilder();

        while (N > 0) {

            N--;
            LetterSequences.append((char) (N % 26 + 'A'));
            N /= 26;

        }

        for (int i = LetterSequences.length() - 1; i >= 0; i--) {
            System.out.print(LetterSequences.charAt(i));
        }

        System.out.println();

    }

}
0