結果
| 問題 |
No.327 アルファベット列
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-16 13:37:48 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 23 ms / 2,000 ms |
| コード長 | 711 bytes |
| コンパイル時間 | 1,549 ms |
| コンパイル使用メモリ | 112,372 KB |
| 実行使用メモリ | 25,820 KB |
| 最終ジャッジ日時 | 2024-11-25 02:46:58 |
| 合計ジャッジ時間 | 3,542 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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.
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
namespace yukicoder
{
public class Program
{
public static void Main()
{
var n = long.Parse(Console.ReadLine());
long i = 26;
long 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();
}
}
}