結果

問題 No.327 アルファベット列
ユーザー 37zigen
提出日時 2016-03-22 16:08:09
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 560 bytes
コンパイル時間 2,065 ms
コンパイル使用メモリ 76,220 KB
実行使用メモリ 42,660 KB
最終ジャッジ日時 2024-10-01 12:56:37
合計ジャッジ時間 10,480 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 RE * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder327;
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		char[] f={'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'};
		
//		26characters;abcdefghijklmnopqrstuvwxyz
//26進数に変換すればいい!
		String ans="";
//		if(n==0){
//			System.out.println(f[0]);
//			System.exit(0);
//		}
		while(n>=0){
			int a=n%26;
			n=(n-a)/26-1;
			ans=f[a]+ans;
		}
		System.out.println(ans);
	}
}
0