結果

問題 No.327 アルファベット列
ユーザー hhgfhn1hhgfhn1
提出日時 2018-11-04 13:11:08
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 605 bytes
コンパイル時間 1,781 ms
コンパイル使用メモリ 74,928 KB
実行使用メモリ 56,164 KB
最終ジャッジ日時 2024-04-30 21:41:32
合計ジャッジ時間 8,973 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
53,880 KB
testcase_01 AC 101 ms
53,096 KB
testcase_02 AC 112 ms
54,052 KB
testcase_03 WA -
testcase_04 RE -
testcase_05 AC 112 ms
54,104 KB
testcase_06 RE -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 WA -
testcase_32 RE -
testcase_33 WA -
testcase_34 WA -
testcase_35 RE -
testcase_36 RE -
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 RE -
testcase_43 RE -
testcase_44 RE -
testcase_45 RE -
testcase_46 RE -
testcase_47 RE -
testcase_48 RE -
testcase_49 RE -
testcase_50 RE -
testcase_51 RE -
testcase_52 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		String a[] = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S",
				"T", "U", "V", "W", "X", "Y", "Z" };
		int cnt=0;
		for(int i=n;i>25;i/=26) {
			cnt++;
		}
		for(int i=0;i<=cnt;i++) {
			if(i==0) {
				System.out.print(a[(int) (n/Math.pow(26, i)%26)]);
			}else {
				System.out.print(a[(int) (n/Math.pow(26, i)%26)-1]);
			}
		}
		System.out.println("");
	}
}
0