結果

問題 No.327 アルファベット列
ユーザー spacia
提出日時 2016-06-03 13:41:49
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 605 bytes
コンパイル時間 2,084 ms
コンパイル使用メモリ 76,472 KB
実行使用メモリ 41,856 KB
最終ジャッジ日時 2024-10-08 06:16:46
合計ジャッジ時間 10,701 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 8 RE * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);

		System.out.println(solve(sc.nextLong()));

		sc.close();
	}

	public static String solve (long n) {
		String[] alp = {"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"};
		String ret = alp[(int)n % alp.length];
		n /= alp.length;
		while (n != 0) {
			int a = (int)n % alp.length - 1;
			if (a == -1) a = alp.length - 1;
			ret = alp[a] + ret;
			if (n == alp.length) break;
			n /= alp.length;
		}
		return ret;
	}

}
0