結果

問題 No.327 アルファベット列
ユーザー ぴろずぴろず
提出日時 2015-12-20 21:55:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 144 ms / 2,000 ms
コード長 446 bytes
コンパイル時間 2,197 ms
コンパイル使用メモリ 73,968 KB
実行使用メモリ 41,880 KB
最終ジャッジ日時 2024-04-16 07:26:59
合計ジャッジ時間 11,030 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
41,368 KB
testcase_01 AC 132 ms
41,228 KB
testcase_02 AC 134 ms
41,668 KB
testcase_03 AC 137 ms
41,368 KB
testcase_04 AC 134 ms
41,368 KB
testcase_05 AC 135 ms
41,204 KB
testcase_06 AC 137 ms
41,360 KB
testcase_07 AC 138 ms
41,284 KB
testcase_08 AC 135 ms
41,404 KB
testcase_09 AC 139 ms
41,640 KB
testcase_10 AC 136 ms
41,492 KB
testcase_11 AC 135 ms
41,544 KB
testcase_12 AC 134 ms
41,576 KB
testcase_13 AC 137 ms
41,372 KB
testcase_14 AC 136 ms
41,200 KB
testcase_15 AC 138 ms
41,880 KB
testcase_16 AC 137 ms
41,300 KB
testcase_17 AC 135 ms
41,240 KB
testcase_18 AC 136 ms
41,424 KB
testcase_19 AC 138 ms
41,444 KB
testcase_20 AC 139 ms
41,448 KB
testcase_21 AC 137 ms
41,448 KB
testcase_22 AC 136 ms
41,236 KB
testcase_23 AC 134 ms
41,596 KB
testcase_24 AC 142 ms
41,436 KB
testcase_25 AC 135 ms
41,576 KB
testcase_26 AC 135 ms
41,664 KB
testcase_27 AC 138 ms
41,536 KB
testcase_28 AC 122 ms
40,124 KB
testcase_29 AC 135 ms
41,572 KB
testcase_30 AC 141 ms
41,480 KB
testcase_31 AC 139 ms
41,312 KB
testcase_32 AC 136 ms
41,592 KB
testcase_33 AC 134 ms
41,096 KB
testcase_34 AC 136 ms
41,508 KB
testcase_35 AC 138 ms
41,584 KB
testcase_36 AC 144 ms
41,460 KB
testcase_37 AC 138 ms
41,636 KB
testcase_38 AC 134 ms
41,196 KB
testcase_39 AC 135 ms
41,232 KB
testcase_40 AC 136 ms
41,456 KB
testcase_41 AC 137 ms
41,404 KB
testcase_42 AC 135 ms
41,312 KB
testcase_43 AC 133 ms
41,208 KB
testcase_44 AC 133 ms
41,628 KB
testcase_45 AC 140 ms
41,316 KB
testcase_46 AC 131 ms
41,220 KB
testcase_47 AC 129 ms
41,336 KB
testcase_48 AC 130 ms
41,364 KB
testcase_49 AC 142 ms
41,832 KB
testcase_50 AC 133 ms
41,396 KB
testcase_51 AC 133 ms
41,708 KB
testcase_52 AC 121 ms
40,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no327;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong() + 1;
		long[] ans = new long[15];
		int l = 0;
		while(n > 0) {
			ans[l] += n % 26;
			if (ans[l] == 0) {
				ans[l] = 26;
				n -= 26;
			}
			l++;
			n /= 26;
		}
		for(int i=l-1;i>=0;i--) {
			System.out.print((char) (ans[i] - 1 + 'A'));
		}
		System.out.println();
	}

}
0