結果

問題 No.327 アルファベット列
ユーザー yun_app
提出日時 2016-05-13 12:22:08
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 881 bytes
コンパイル時間 3,241 ms
コンパイル使用メモリ 75,576 KB
実行使用メモリ 52,220 KB
最終ジャッジ日時 2024-10-05 14:16:36
合計ジャッジ時間 6,814 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 38 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
    public static void main (String[] args) throws java.lang.Exception
    {
        // your code goes here
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        long n = Long.parseLong(br.readLine());
        if(n==0){
            System.out.println("A");
            return;
        }
        ArrayList<Long> pool = new ArrayList<Long>();
        while(n>0l){
            pool.add(n%26l);
            n /= 26l;
            n--;
        }
        Collections.reverse(pool);
        System.out.print((char)('A'+pool.get(0)));
        for(int i=1;i<pool.size();i++){
            System.out.print((char)('A'+pool.get(i)));
        }
        
    }
}
0