結果

問題 No.327 アルファベット列
ユーザー GrenacheGrenache
提出日時 2015-12-20 00:24:25
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 1,975 bytes
コンパイル時間 3,837 ms
コンパイル使用メモリ 79,804 KB
実行使用メモリ 53,712 KB
最終ジャッジ日時 2023-10-17 13:04:02
合計ジャッジ時間 8,262 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
52,596 KB
testcase_01 AC 55 ms
53,676 KB
testcase_02 AC 56 ms
53,672 KB
testcase_03 AC 55 ms
52,720 KB
testcase_04 AC 55 ms
51,640 KB
testcase_05 AC 55 ms
53,684 KB
testcase_06 AC 56 ms
53,620 KB
testcase_07 AC 58 ms
53,672 KB
testcase_08 AC 56 ms
53,680 KB
testcase_09 AC 57 ms
53,672 KB
testcase_10 AC 56 ms
53,676 KB
testcase_11 AC 56 ms
53,680 KB
testcase_12 AC 56 ms
53,680 KB
testcase_13 AC 58 ms
52,732 KB
testcase_14 AC 57 ms
53,672 KB
testcase_15 AC 56 ms
52,560 KB
testcase_16 AC 56 ms
52,744 KB
testcase_17 AC 58 ms
53,680 KB
testcase_18 AC 57 ms
53,684 KB
testcase_19 AC 56 ms
53,700 KB
testcase_20 AC 56 ms
53,676 KB
testcase_21 RE -
testcase_22 WA -
testcase_23 RE -
testcase_24 RE -
testcase_25 WA -
testcase_26 RE -
testcase_27 RE -
testcase_28 WA -
testcase_29 RE -
testcase_30 AC 56 ms
53,680 KB
testcase_31 AC 57 ms
53,680 KB
testcase_32 RE -
testcase_33 AC 55 ms
53,680 KB
testcase_34 AC 55 ms
53,680 KB
testcase_35 WA -
testcase_36 WA -
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 WA -
testcase_46 RE -
testcase_47 WA -
testcase_48 WA -
testcase_49 RE -
testcase_50 RE -
testcase_51 RE -
testcase_52 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Deque;
import java.util.Iterator;


public class Main_yukicoder327 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Printer pr = new Printer(System.out);

        char[] a = new char[26];
        for (char c = 'A'; c <= 'Z'; c++) {
        	a[c - 'A'] = c;
        }

        long n = sc.nextLong();

        Deque<Character> st = new ArrayDeque<Character>();
    	st.push(a[(int)(n % 26)]);
    	n /= 26;
        while (n > 0) {
        	n = n -1;
        	st.push(a[(int)(n) % 26]);
        	n /= 26;
        }

        for (char c : st) {
        	pr.print(c);
        }
        pr.println();

        pr.close();
        sc.close();
    }

    @SuppressWarnings("unused")
	private static class Scanner {
		BufferedReader br;
		Iterator<String> it;

		Scanner (InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));
		}

		String next() throws RuntimeException  {
			try {
				if (it == null || !it.hasNext()) {
					it = Arrays.asList(br.readLine().split(" ")).iterator();
				}
				return it.next();
			} catch (IOException e) {
				throw new IllegalStateException();
			}
		}

		int nextInt() throws RuntimeException {
			return Integer.parseInt(next());
		}

		long nextLong() throws RuntimeException {
			return Long.parseLong(next());
		}

		float nextFloat() throws RuntimeException {
			return Float.parseFloat(next());
		}

		double nextDouble() throws RuntimeException {
			return Double.parseDouble(next());
		}

		void close() {
			try {
				br.close();
			} catch (IOException e) {
//				throw new IllegalStateException();
			}
		}
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
0