結果

問題 No.327 アルファベット列
ユーザー crazybbb3crazybbb3
提出日時 2016-11-28 20:07:17
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,979 bytes
コンパイル時間 2,512 ms
コンパイル使用メモリ 76,952 KB
実行使用メモリ 54,208 KB
最終ジャッジ日時 2023-08-18 08:53:15
合計ジャッジ時間 9,787 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
52,708 KB
testcase_01 WA -
testcase_02 AC 84 ms
53,048 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 80 ms
51,196 KB
testcase_06 WA -
testcase_07 AC 83 ms
50,804 KB
testcase_08 AC 84 ms
52,816 KB
testcase_09 AC 80 ms
52,528 KB
testcase_10 AC 80 ms
53,020 KB
testcase_11 AC 80 ms
52,844 KB
testcase_12 AC 80 ms
52,652 KB
testcase_13 AC 81 ms
53,704 KB
testcase_14 AC 85 ms
54,208 KB
testcase_15 AC 83 ms
52,688 KB
testcase_16 AC 80 ms
52,820 KB
testcase_17 AC 78 ms
52,776 KB
testcase_18 AC 79 ms
52,856 KB
testcase_19 AC 84 ms
53,196 KB
testcase_20 AC 84 ms
51,536 KB
testcase_21 AC 90 ms
51,552 KB
testcase_22 WA -
testcase_23 AC 82 ms
53,468 KB
testcase_24 AC 78 ms
52,708 KB
testcase_25 AC 82 ms
53,220 KB
testcase_26 AC 82 ms
53,656 KB
testcase_27 WA -
testcase_28 AC 80 ms
53,476 KB
testcase_29 AC 82 ms
51,372 KB
testcase_30 WA -
testcase_31 AC 80 ms
52,700 KB
testcase_32 AC 85 ms
53,620 KB
testcase_33 WA -
testcase_34 WA -
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.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;

    void solve() throws IOException {
        long n = nl();

        n++;

        ArrayList<Integer> list = new ArrayList<>();

        while (n > 0) {
            list.add((int)(n % 26));
            n /= 26;
        }

        String ans = "";
        for (int i = 0; i < list.size(); i++) {
            ans = (char)('A' + list.get(i) - 1) + ans;
        }

        out.println(ans);
    }

    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }

    int ni() throws IOException {
        return Integer.parseInt(ns());
    }

    long nl() throws IOException {
        return Long.parseLong(ns());
    }

    double nd() throws IOException {
        return Double.parseDouble(ns());
    }

    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }

    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }

    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }

    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
}
0