結果

問題 No.327 アルファベット列
ユーザー AoiroFukurouAoiroFukurou
提出日時 2015-12-26 13:15:54
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 789 bytes
コンパイル時間 3,907 ms
コンパイル使用メモリ 79,940 KB
実行使用メモリ 57,820 KB
最終ジャッジ日時 2023-10-19 04:02:35
合計ジャッジ時間 15,863 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
57,576 KB
testcase_01 AC 137 ms
57,580 KB
testcase_02 AC 139 ms
57,484 KB
testcase_03 AC 140 ms
57,552 KB
testcase_04 AC 140 ms
57,548 KB
testcase_05 AC 142 ms
57,556 KB
testcase_06 RE -
testcase_07 AC 138 ms
57,520 KB
testcase_08 AC 141 ms
57,212 KB
testcase_09 AC 143 ms
57,556 KB
testcase_10 AC 140 ms
57,616 KB
testcase_11 AC 141 ms
57,500 KB
testcase_12 AC 141 ms
57,260 KB
testcase_13 AC 143 ms
57,248 KB
testcase_14 AC 140 ms
57,408 KB
testcase_15 AC 142 ms
57,664 KB
testcase_16 AC 142 ms
57,556 KB
testcase_17 AC 139 ms
57,548 KB
testcase_18 AC 140 ms
57,180 KB
testcase_19 AC 140 ms
57,588 KB
testcase_20 AC 143 ms
57,604 KB
testcase_21 AC 142 ms
57,516 KB
testcase_22 AC 142 ms
57,704 KB
testcase_23 AC 142 ms
57,512 KB
testcase_24 AC 140 ms
57,740 KB
testcase_25 AC 140 ms
57,268 KB
testcase_26 AC 139 ms
57,692 KB
testcase_27 AC 142 ms
57,724 KB
testcase_28 AC 144 ms
57,492 KB
testcase_29 AC 139 ms
57,496 KB
testcase_30 AC 140 ms
57,496 KB
testcase_31 AC 139 ms
57,588 KB
testcase_32 AC 142 ms
57,556 KB
testcase_33 AC 144 ms
57,528 KB
testcase_34 AC 143 ms
57,248 KB
testcase_35 RE -
testcase_36 RE -
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 RE -
testcase_43 RE -
testcase_44 RE -
testcase_45 RE -
testcase_46 RE -
testcase_47 RE -
testcase_48 RE -
testcase_49 RE -
testcase_50 RE -
testcase_51 RE -
testcase_52 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No_327 {
public static void main(String[] args) {
	String[] Alf = {"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"};
	long[] An = new long[20];
	long[] Le = new long[20];
	Scanner sc = new Scanner(System.in);
	long N = sc.nextLong();
	sc.close();
	Long A = N;
	int C = -1;
	String ans = "";
	if(N <= 25){
		ans = Alf[(int)N];
	}else if(N <=701){
		ans+= Alf[((int)N / 26)-1];
		ans+= Alf[(int)N % 26];
	}else{
	while(A>=27){
		A /= 26;
		C++;
	}
	for(int i = 0; i <= C; i++){
		Le[i] = N % 26;
		N /= 26;
	}
	ans+= Alf[(int)N-1];
	for(int i = C; i >= 1; i--){
		ans += Alf[(int)Le[i]-1];
	}
	ans += Alf[(int)Le[0]];
	}
	System.out.println(ans);
		}
}
0