結果

問題 No.327 アルファベット列
ユーザー bluemeganebluemegane
提出日時 2020-09-09 17:20:13
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,162 bytes
コンパイル時間 1,969 ms
コンパイル使用メモリ 67,724 KB
実行使用メモリ 23,588 KB
最終ジャッジ日時 2023-08-22 03:39:46
合計ジャッジ時間 7,707 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 57 ms
23,396 KB
testcase_03 AC 57 ms
21,316 KB
testcase_04 AC 57 ms
21,324 KB
testcase_05 AC 56 ms
21,332 KB
testcase_06 AC 57 ms
23,376 KB
testcase_07 AC 57 ms
21,308 KB
testcase_08 AC 57 ms
21,324 KB
testcase_09 AC 57 ms
19,664 KB
testcase_10 AC 58 ms
21,384 KB
testcase_11 AC 57 ms
19,324 KB
testcase_12 AC 57 ms
21,312 KB
testcase_13 AC 57 ms
21,376 KB
testcase_14 AC 58 ms
23,360 KB
testcase_15 AC 58 ms
21,472 KB
testcase_16 AC 58 ms
21,316 KB
testcase_17 AC 58 ms
23,504 KB
testcase_18 AC 58 ms
23,468 KB
testcase_19 AC 57 ms
21,328 KB
testcase_20 AC 58 ms
23,424 KB
testcase_21 AC 58 ms
21,600 KB
testcase_22 AC 57 ms
21,412 KB
testcase_23 AC 58 ms
21,364 KB
testcase_24 AC 58 ms
21,336 KB
testcase_25 AC 58 ms
23,588 KB
testcase_26 AC 57 ms
21,548 KB
testcase_27 AC 58 ms
23,360 KB
testcase_28 AC 57 ms
21,404 KB
testcase_29 AC 58 ms
23,384 KB
testcase_30 AC 57 ms
21,364 KB
testcase_31 AC 57 ms
21,488 KB
testcase_32 AC 58 ms
21,364 KB
testcase_33 AC 57 ms
21,552 KB
testcase_34 AC 57 ms
21,480 KB
testcase_35 AC 57 ms
21,336 KB
testcase_36 AC 57 ms
21,352 KB
testcase_37 AC 57 ms
21,408 KB
testcase_38 AC 58 ms
21,428 KB
testcase_39 AC 57 ms
21,476 KB
testcase_40 AC 58 ms
21,388 KB
testcase_41 AC 58 ms
23,420 KB
testcase_42 AC 57 ms
19,484 KB
testcase_43 AC 58 ms
21,340 KB
testcase_44 AC 57 ms
23,368 KB
testcase_45 AC 58 ms
23,392 KB
testcase_46 AC 57 ms
19,308 KB
testcase_47 AC 57 ms
21,336 KB
testcase_48 AC 57 ms
21,360 KB
testcase_49 AC 58 ms
21,512 KB
testcase_50 AC 57 ms
19,496 KB
testcase_51 AC 57 ms
21,316 KB
testcase_52 AC 57 ms
21,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Hello
{
    static void Main()
    {
        var n = long.Parse(Console.ReadLine().Trim());
        var a = getL(n);
        getAns(a);
    }
    static void getAns(List<int> a)
    {
        var ans = "";
        var k = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        ans += k[a[0]];
        for (int i = 1; i < a.Count(); i++)
        {
            var x = a[i] - 1 >= 0 ? a[i] - 1 : a[i] + 25;
            ans += k[x];
        }
        var ans2 = ans.ToCharArray();
        Array.Reverse(ans2);
        Console.WriteLine(new string(ans2));
    }
    static List<int> getL(long n)
    {
        var res = new List<int>();
        var t = n;
        res.Add((int)(t % 26));
        t /= 26;
        while (true)
        {
            var x = t % 26;
            if (x == 0)
            {
                res.Add(26);
                t /= 26;
                t--;
                if (t <= 0) break;
            }
            else
            {
            res.Add((int)(t % 26));
            t /= 26;
                if (t <= 0) break;

            }
        }
        return res;
    }
}
0