結果

問題 No.327 アルファベット列
ユーザー kou6839kou6839
提出日時 2015-12-20 00:52:49
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 783 bytes
コンパイル時間 2,969 ms
コンパイル使用メモリ 79,176 KB
実行使用メモリ 58,672 KB
最終ジャッジ日時 2023-10-17 13:08:16
合計ジャッジ時間 13,019 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 165 ms
58,472 KB
testcase_01 AC 166 ms
58,380 KB
testcase_02 AC 166 ms
58,444 KB
testcase_03 AC 167 ms
58,544 KB
testcase_04 AC 169 ms
58,444 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 168 ms
58,520 KB
testcase_08 AC 165 ms
58,312 KB
testcase_09 AC 164 ms
58,356 KB
testcase_10 WA -
testcase_11 AC 161 ms
58,320 KB
testcase_12 AC 166 ms
58,260 KB
testcase_13 AC 167 ms
58,320 KB
testcase_14 AC 167 ms
58,420 KB
testcase_15 AC 168 ms
58,468 KB
testcase_16 AC 169 ms
58,344 KB
testcase_17 AC 165 ms
58,444 KB
testcase_18 AC 166 ms
58,588 KB
testcase_19 WA -
testcase_20 AC 165 ms
58,456 KB
testcase_21 AC 166 ms
58,336 KB
testcase_22 AC 167 ms
58,248 KB
testcase_23 AC 167 ms
58,376 KB
testcase_24 AC 166 ms
58,456 KB
testcase_25 WA -
testcase_26 AC 164 ms
58,484 KB
testcase_27 AC 166 ms
56,476 KB
testcase_28 WA -
testcase_29 AC 166 ms
58,336 KB
testcase_30 AC 166 ms
58,508 KB
testcase_31 WA -
testcase_32 AC 165 ms
58,432 KB
testcase_33 AC 163 ms
58,332 KB
testcase_34 AC 167 ms
58,524 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.net.NetworkInterface;
import java.util.*;

public class Main {
	static long gcd(long a,long b){
		return b == 0 ? a : gcd(b, a%b);
	}
	static long lcm(long a, long b){
		return a*b/gcd(a, b);
	}
	static int[] dx = {1,0,-1,0};
	static int[] dy = {0,1,0,-1};
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		long n = sc.nextLong();
		String ans = "";
		ans+=(char)((int)'A'+n%26);
		if(n<=25){
			System.out.println(ans);
			return;
		}
		if(n==26){
			System.out.println("AA");
			return;
		}
		int ind = 1;
		while(n>=Math.pow(27, ind)) ind++;
		ind--;
		String unko="";
		for(int i=ind;i>=1;i--){
			unko+=(char)((int)'A'+(int)(n/Math.pow(26, i))+(ind==1?-1:-1));
			n%=Math.pow(26, i);
		}
		System.out.println(unko+ans);
	} 
}
0