結果

問題 No.327 アルファベット列
ユーザー AoiroFukurouAoiroFukurou
提出日時 2016-01-04 15:41:17
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 819 bytes
コンパイル時間 3,631 ms
コンパイル使用メモリ 77,604 KB
実行使用メモリ 57,748 KB
最終ジャッジ日時 2023-10-19 15:03:25
合計ジャッジ時間 13,242 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
57,524 KB
testcase_01 AC 138 ms
57,536 KB
testcase_02 AC 137 ms
57,320 KB
testcase_03 AC 141 ms
57,560 KB
testcase_04 WA -
testcase_05 AC 143 ms
57,328 KB
testcase_06 WA -
testcase_07 AC 144 ms
57,204 KB
testcase_08 AC 142 ms
57,076 KB
testcase_09 AC 141 ms
57,024 KB
testcase_10 AC 138 ms
57,356 KB
testcase_11 AC 139 ms
57,360 KB
testcase_12 AC 137 ms
57,528 KB
testcase_13 AC 136 ms
57,324 KB
testcase_14 AC 137 ms
57,076 KB
testcase_15 AC 138 ms
57,356 KB
testcase_16 AC 141 ms
57,008 KB
testcase_17 AC 141 ms
57,028 KB
testcase_18 AC 140 ms
57,364 KB
testcase_19 AC 139 ms
57,676 KB
testcase_20 AC 139 ms
57,508 KB
testcase_21 AC 139 ms
57,528 KB
testcase_22 AC 139 ms
57,320 KB
testcase_23 AC 142 ms
57,444 KB
testcase_24 AC 139 ms
57,060 KB
testcase_25 AC 138 ms
57,272 KB
testcase_26 AC 137 ms
57,500 KB
testcase_27 AC 138 ms
57,348 KB
testcase_28 AC 137 ms
57,320 KB
testcase_29 AC 138 ms
57,356 KB
testcase_30 WA -
testcase_31 AC 138 ms
57,348 KB
testcase_32 AC 138 ms
57,516 KB
testcase_33 AC 139 ms
57,568 KB
testcase_34 AC 134 ms
57,588 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

package yuki_coder;

import java.util.Scanner;

public class No_327 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		sc.close();
		if(N==0){
			System.out.println("A");
		}else if(N < 26){
			System.out.println((char)('A' + N));
		}else if(N>=26){
			long[] ans = new long[12];
			int c = 0;
			long copy = N;
			while(copy >= 26){
				copy /= 26;
				c++;
			}
			copy = N;
			for(int i = c; i >=0; i--){
				if(i!=0){
					ans[i] = copy % 26;
					if(i != 1){
					copy /= 26;
					}
				}else if(i==0){
					ans[i] = copy / 26;
				}
			}
			for(int i = 0; i <= c; i++){
				if(i==c){
					System.out.println((char)(ans[i] + 'A'));
				}else{
					if(ans[i] != 0){
					ans[i] -= 1;
					}
					System.out.print((char)(ans[i] + 'A'));
				}
			}
		}
	}
}
0