結果

問題 No.327 アルファベット列
ユーザー ym678ym678
提出日時 2016-09-03 13:20:16
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,560 bytes
コンパイル時間 2,248 ms
コンパイル使用メモリ 77,648 KB
実行使用メモリ 54,536 KB
最終ジャッジ日時 2024-04-27 15:17:17
合計ジャッジ時間 9,617 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
53,888 KB
testcase_01 AC 109 ms
52,580 KB
testcase_02 AC 124 ms
53,932 KB
testcase_03 AC 116 ms
53,872 KB
testcase_04 AC 119 ms
53,728 KB
testcase_05 AC 105 ms
52,852 KB
testcase_06 AC 116 ms
54,120 KB
testcase_07 WA -
testcase_08 AC 123 ms
53,816 KB
testcase_09 AC 124 ms
54,160 KB
testcase_10 AC 123 ms
54,064 KB
testcase_11 AC 117 ms
53,852 KB
testcase_12 WA -
testcase_13 AC 118 ms
53,900 KB
testcase_14 AC 105 ms
52,676 KB
testcase_15 WA -
testcase_16 AC 120 ms
54,284 KB
testcase_17 WA -
testcase_18 AC 119 ms
53,736 KB
testcase_19 AC 120 ms
54,008 KB
testcase_20 AC 115 ms
53,936 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 122 ms
53,724 KB
testcase_25 AC 104 ms
52,980 KB
testcase_26 AC 118 ms
53,732 KB
testcase_27 AC 120 ms
53,792 KB
testcase_28 WA -
testcase_29 AC 113 ms
53,392 KB
testcase_30 AC 120 ms
53,960 KB
testcase_31 AC 122 ms
53,924 KB
testcase_32 WA -
testcase_33 AC 119 ms
53,932 KB
testcase_34 AC 119 ms
53,744 KB
testcase_35 AC 120 ms
54,008 KB
testcase_36 AC 122 ms
53,920 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 120 ms
54,420 KB
testcase_41 AC 131 ms
53,856 KB
testcase_42 AC 126 ms
54,104 KB
testcase_43 AC 118 ms
54,032 KB
testcase_44 AC 119 ms
54,104 KB
testcase_45 WA -
testcase_46 AC 123 ms
54,072 KB
testcase_47 WA -
testcase_48 AC 113 ms
53,468 KB
testcase_49 AC 117 ms
53,076 KB
testcase_50 AC 117 ms
53,940 KB
testcase_51 AC 116 ms
53,984 KB
testcase_52 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		
		long N = sc.nextLong();
		int alp = (int) (N%26);
		N /= 26;
		str(alp,sb);
		
		while(N > 0){
			N --;
			alp = (int) (N%26);
			N /= 26;			
			str(alp,sb);
		}

		
		sb.reverse();
		String ans = sb.toString();
		System.out.println(ans);
	}
	
	public static void str(int alp,StringBuilder sb){

		if(alp == 0){
			sb.append("A");
		}else if(alp == 1){
			sb.append("B");
		}else if(alp == 2){
			sb.append("C");
		}else if(alp == 3){
			sb.append("D");
		}else if(alp == 4){
			sb.append("E");
		}else if(alp == 5){
			sb.append("F");
		}else if(alp == 6){
			sb.append("G");
		}else if(alp == 7){
			sb.append("H");
		}else if(alp == 8){
			sb.append("I");
		}else if(alp == 9){
			sb.append("J");
		}else if(alp == 10){
			sb.append("K");
		}else if(alp == 11){
			sb.append("L");
		}else if(alp == 12){
			sb.append("N");
		}else if(alp == 13){
			sb.append("M");
		}else if(alp == 14){
			sb.append("O");
		}else if(alp == 15){
			sb.append("P");
		}else if(alp == 16){
			sb.append("Q");
		}else if(alp == 17){
			sb.append("R");
		}else if(alp == 18){
			sb.append("C");
		}else if(alp == 19){
			sb.append("T");
		}else if(alp == 20){
			sb.append("U");
		}else if(alp == 21){
			sb.append("V");
		}else if(alp == 22){
			sb.append("W");
		}else if(alp == 23){
			sb.append("X");
		}else if(alp == 24){
			sb.append("Y");
		}else if(alp == 25){
			sb.append("Z");
		}
	}
}
		
0