結果

問題 No.327 アルファベット列
ユーザー jp_stejp_ste
提出日時 2016-02-01 06:48:42
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 656 bytes
コンパイル時間 3,243 ms
コンパイル使用メモリ 84,676 KB
実行使用メモリ 57,848 KB
最終ジャッジ日時 2023-10-21 18:27:02
合計ジャッジ時間 10,855 ms
ジャッジサーバーID
(参考情報)
judge9 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
57,352 KB
testcase_01 AC 126 ms
57,572 KB
testcase_02 AC 131 ms
57,412 KB
testcase_03 AC 126 ms
57,488 KB
testcase_04 WA -
testcase_05 AC 127 ms
57,504 KB
testcase_06 WA -
testcase_07 AC 130 ms
57,412 KB
testcase_08 AC 127 ms
57,412 KB
testcase_09 AC 130 ms
57,424 KB
testcase_10 AC 130 ms
57,412 KB
testcase_11 AC 129 ms
57,360 KB
testcase_12 AC 126 ms
57,524 KB
testcase_13 AC 128 ms
57,408 KB
testcase_14 AC 119 ms
56,264 KB
testcase_15 AC 131 ms
57,360 KB
testcase_16 AC 134 ms
57,576 KB
testcase_17 AC 130 ms
57,400 KB
testcase_18 AC 130 ms
57,344 KB
testcase_19 AC 132 ms
57,648 KB
testcase_20 AC 134 ms
57,500 KB
testcase_21 AC 137 ms
57,400 KB
testcase_22 AC 136 ms
57,512 KB
testcase_23 AC 133 ms
57,384 KB
testcase_24 AC 141 ms
57,592 KB
testcase_25 AC 139 ms
57,544 KB
testcase_26 AC 137 ms
57,356 KB
testcase_27 AC 132 ms
57,392 KB
testcase_28 AC 132 ms
57,480 KB
testcase_29 AC 130 ms
55,544 KB
testcase_30 WA -
testcase_31 AC 131 ms
57,384 KB
testcase_32 AC 133 ms
55,600 KB
testcase_33 AC 130 ms
57,260 KB
testcase_34 AC 130 ms
57,492 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 #

import java.util.Scanner;
import java.util.Stack;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long N = scan.nextLong();
		
		if(N < 26) {
			System.out.println((char)(N+'A'));
		} else {
			Stack<Long> stack = new Stack();
			long value = N;
			while(true) {
				long tmp1 = value / 26;
				long tmp2 = value % 26;
				stack.push(tmp2);
				if(tmp1 < 26) {
					stack.push(tmp1);
					break;
				}
				value = tmp1;
			}
			
			while(!stack.empty()) {
				Long v = stack.pop();
				if(!stack.empty()) {
					v--;
				}
				System.out.print((char)(v+'A'));
			}
			System.out.println();
		}
	}
}
0