結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
55,836 KB
testcase_01 AC 137 ms
57,744 KB
testcase_02 AC 140 ms
57,528 KB
testcase_03 AC 138 ms
57,552 KB
testcase_04 AC 138 ms
57,528 KB
testcase_05 AC 136 ms
57,472 KB
testcase_06 AC 140 ms
57,492 KB
testcase_07 AC 140 ms
57,684 KB
testcase_08 AC 138 ms
57,592 KB
testcase_09 AC 141 ms
57,724 KB
testcase_10 AC 142 ms
57,492 KB
testcase_11 AC 140 ms
57,820 KB
testcase_12 AC 142 ms
57,660 KB
testcase_13 AC 143 ms
57,784 KB
testcase_14 AC 142 ms
57,620 KB
testcase_15 AC 141 ms
57,660 KB
testcase_16 AC 140 ms
57,264 KB
testcase_17 AC 139 ms
57,592 KB
testcase_18 AC 141 ms
57,460 KB
testcase_19 AC 139 ms
57,652 KB
testcase_20 AC 144 ms
57,720 KB
testcase_21 AC 143 ms
57,596 KB
testcase_22 AC 142 ms
57,752 KB
testcase_23 AC 138 ms
57,644 KB
testcase_24 AC 137 ms
57,660 KB
testcase_25 AC 140 ms
57,592 KB
testcase_26 AC 139 ms
57,804 KB
testcase_27 AC 140 ms
57,656 KB
testcase_28 AC 141 ms
57,496 KB
testcase_29 AC 138 ms
57,252 KB
testcase_30 AC 137 ms
57,492 KB
testcase_31 AC 139 ms
57,460 KB
testcase_32 AC 141 ms
57,556 KB
testcase_33 AC 139 ms
57,444 KB
testcase_34 AC 139 ms
57,632 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[] 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 if(N >= 1352 && N <= 1377){
		ans += Alf[0];
		ans += Alf[25];
		ans += Alf[(int)N % 52];
	}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