結果

問題 No.327 アルファベット列
ユーザー hhgfhn1
提出日時 2018-11-04 13:11:08
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 605 bytes
コンパイル時間 1,847 ms
コンパイル使用メモリ 74,388 KB
実行使用メモリ 56,328 KB
最終ジャッジ日時 2024-11-20 19:48:31
合計ジャッジ時間 9,283 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 1 WA * 15 RE * 34
権限があれば一括ダウンロードができます

ソースコード

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