結果

問題 No.327 アルファベット列
ユーザー NetSeed
提出日時 2015-12-27 01:41:05
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 589 bytes
コンパイル時間 1,046 ms
コンパイル使用メモリ 113,996 KB
実行使用メモリ 27,232 KB
最終ジャッジ日時 2024-10-06 22:21:15
合計ジャッジ時間 3,937 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 50
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
using System.Text;

namespace ConsoleApplication3
{
	class Program
	{
		private static readonly List<char> ConvertTable = Enumerable.Range(0x41, 26).Select(x => (char) x).ToList();
		static void Main(string[] args)
		{
			var n = long.Parse(Console.ReadLine());
			var buff = new List<char> {ConvertTable[(int) (n%26)]};
			while ((n /= 26) != 0)
			{
				buff.Add(ConvertTable[(int) (--n%26)]);
			}
			buff.Reverse();
			Console.WriteLine(buff.Aggregate(new StringBuilder(), (b, c) => b.Append(c)).ToString());
		}
	}
}
0