結果

問題 No.327 アルファベット列
ユーザー kenji_shioyakenji_shioya
提出日時 2016-05-30 16:53:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 571 bytes
コンパイル時間 3,661 ms
コンパイル使用メモリ 76,820 KB
実行使用メモリ 41,844 KB
最終ジャッジ日時 2024-04-16 18:44:09
合計ジャッジ時間 12,022 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
41,708 KB
testcase_01 AC 133 ms
41,460 KB
testcase_02 AC 133 ms
41,636 KB
testcase_03 AC 135 ms
41,164 KB
testcase_04 AC 135 ms
41,260 KB
testcase_05 AC 136 ms
41,156 KB
testcase_06 AC 133 ms
41,480 KB
testcase_07 AC 134 ms
41,484 KB
testcase_08 AC 135 ms
41,844 KB
testcase_09 AC 136 ms
41,500 KB
testcase_10 AC 136 ms
41,392 KB
testcase_11 AC 131 ms
41,460 KB
testcase_12 AC 134 ms
41,444 KB
testcase_13 AC 133 ms
41,452 KB
testcase_14 AC 136 ms
41,344 KB
testcase_15 AC 121 ms
40,244 KB
testcase_16 AC 134 ms
41,488 KB
testcase_17 AC 132 ms
41,344 KB
testcase_18 AC 133 ms
41,436 KB
testcase_19 AC 136 ms
41,656 KB
testcase_20 AC 136 ms
41,344 KB
testcase_21 AC 121 ms
40,204 KB
testcase_22 AC 132 ms
41,128 KB
testcase_23 AC 134 ms
41,400 KB
testcase_24 AC 131 ms
41,168 KB
testcase_25 AC 133 ms
41,660 KB
testcase_26 AC 134 ms
41,168 KB
testcase_27 AC 135 ms
41,548 KB
testcase_28 AC 136 ms
41,444 KB
testcase_29 AC 134 ms
41,324 KB
testcase_30 AC 137 ms
41,436 KB
testcase_31 AC 132 ms
41,316 KB
testcase_32 AC 132 ms
41,508 KB
testcase_33 AC 135 ms
41,368 KB
testcase_34 AC 121 ms
40,288 KB
testcase_35 AC 135 ms
41,416 KB
testcase_36 AC 135 ms
41,508 KB
testcase_37 AC 135 ms
41,228 KB
testcase_38 AC 134 ms
41,340 KB
testcase_39 AC 135 ms
41,324 KB
testcase_40 AC 136 ms
41,028 KB
testcase_41 AC 131 ms
41,260 KB
testcase_42 AC 133 ms
41,176 KB
testcase_43 AC 133 ms
41,564 KB
testcase_44 AC 131 ms
41,160 KB
testcase_45 AC 133 ms
41,036 KB
testcase_46 AC 135 ms
41,316 KB
testcase_47 AC 134 ms
41,444 KB
testcase_48 AC 134 ms
41,384 KB
testcase_49 AC 133 ms
41,600 KB
testcase_50 AC 133 ms
41,492 KB
testcase_51 AC 134 ms
40,904 KB
testcase_52 AC 134 ms
41,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Exercise36{
  public static void main (String[] args){

    Scanner sc = new Scanner(System.in);

    long number = sc.nextLong();

    String[] alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");

    String answer = getAlphabets(number, alphabet);

    System.out.println(answer);
  }

  private static String getAlphabets(long number, String[] alphabet){
    long b = number % 26;

    if (number / 26 == 0){
      return alphabet[(int)b];
    }else{
      return getAlphabets(number / 26 - 1, alphabet) + alphabet[(int)b];
    }
  }
}
0