結果

問題 No.327 アルファベット列
ユーザー 抹茶アイス
提出日時 2023-08-16 13:35:54
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 709 bytes
コンパイル時間 793 ms
コンパイル使用メモリ 108,276 KB
実行使用メモリ 48,380 KB
最終ジャッジ日時 2024-11-25 02:45:12
合計ジャッジ時間 96,000 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17 WA * 2 TLE * 31
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

namespace yukicoder
{
    public class Program
    {
        public static void Main()
        {
            var n = long.Parse(Console.ReadLine());
            var i = 26;
            var j = 1;
            while (n >= i)
            {
                n -= i;
                i *= 26;
                j++;
            }
            var a = new long[j];
            for (i = 0; i < j; i++)
            {
                a[j - 1 - i] = n % 26;
                n /= 26;
            }
            foreach(var m in a)
            {
                Console.Write((char)(m + 'A'));
            }
            Console.WriteLine();
        }
    }
}
0