結果

問題 No.327 アルファベット列
ユーザー 37zigen37zigen
提出日時 2016-03-22 16:11:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 190 ms / 2,000 ms
コード長 568 bytes
コンパイル時間 2,604 ms
コンパイル使用メモリ 75,964 KB
実行使用メモリ 56,692 KB
最終ジャッジ日時 2024-04-16 08:13:38
合計ジャッジ時間 13,300 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 169 ms
54,916 KB
testcase_01 AC 170 ms
54,832 KB
testcase_02 AC 190 ms
54,972 KB
testcase_03 AC 168 ms
55,028 KB
testcase_04 AC 172 ms
54,524 KB
testcase_05 AC 169 ms
54,740 KB
testcase_06 AC 167 ms
54,832 KB
testcase_07 AC 170 ms
55,176 KB
testcase_08 AC 171 ms
54,712 KB
testcase_09 AC 166 ms
54,852 KB
testcase_10 AC 168 ms
54,928 KB
testcase_11 AC 169 ms
55,032 KB
testcase_12 AC 170 ms
54,908 KB
testcase_13 AC 171 ms
54,812 KB
testcase_14 AC 168 ms
54,760 KB
testcase_15 AC 172 ms
54,796 KB
testcase_16 AC 168 ms
54,784 KB
testcase_17 AC 169 ms
54,916 KB
testcase_18 AC 169 ms
54,936 KB
testcase_19 AC 171 ms
55,016 KB
testcase_20 AC 169 ms
55,000 KB
testcase_21 AC 165 ms
54,932 KB
testcase_22 AC 167 ms
55,012 KB
testcase_23 AC 167 ms
54,700 KB
testcase_24 AC 171 ms
55,032 KB
testcase_25 AC 167 ms
54,956 KB
testcase_26 AC 166 ms
54,840 KB
testcase_27 AC 166 ms
55,116 KB
testcase_28 AC 166 ms
55,140 KB
testcase_29 AC 174 ms
55,012 KB
testcase_30 AC 169 ms
54,804 KB
testcase_31 AC 168 ms
55,040 KB
testcase_32 AC 171 ms
55,256 KB
testcase_33 AC 167 ms
55,180 KB
testcase_34 AC 173 ms
55,212 KB
testcase_35 AC 169 ms
55,040 KB
testcase_36 AC 169 ms
54,940 KB
testcase_37 AC 174 ms
55,192 KB
testcase_38 AC 168 ms
54,996 KB
testcase_39 AC 167 ms
54,656 KB
testcase_40 AC 164 ms
55,128 KB
testcase_41 AC 168 ms
54,652 KB
testcase_42 AC 163 ms
54,512 KB
testcase_43 AC 166 ms
54,980 KB
testcase_44 AC 166 ms
54,984 KB
testcase_45 AC 168 ms
54,928 KB
testcase_46 AC 165 ms
54,752 KB
testcase_47 AC 166 ms
55,304 KB
testcase_48 AC 166 ms
54,780 KB
testcase_49 AC 165 ms
56,692 KB
testcase_50 AC 167 ms
54,936 KB
testcase_51 AC 168 ms
54,900 KB
testcase_52 AC 171 ms
54,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder327;
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong();
		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){
			long a=n%26;
			n=(n-a)/26-1;
			ans=f[(int)a]+ans;
		}
		System.out.println(ans);
	}
}
0