結果

問題 No.701 ひとりしりとり
ユーザー bluemeganebluemegane
提出日時 2018-09-06 10:08:52
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 225 ms / 2,000 ms
コード長 629 bytes
コンパイル時間 781 ms
コンパイル使用メモリ 110,868 KB
実行使用メモリ 27,632 KB
最終ジャッジ日時 2024-05-01 08:11:31
合計ジャッジ時間 1,830 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
25,664 KB
testcase_01 AC 20 ms
23,640 KB
testcase_02 AC 20 ms
23,904 KB
testcase_03 AC 20 ms
23,860 KB
testcase_04 AC 20 ms
25,820 KB
testcase_05 AC 20 ms
25,816 KB
testcase_06 AC 21 ms
25,692 KB
testcase_07 AC 21 ms
25,560 KB
testcase_08 AC 21 ms
25,688 KB
testcase_09 AC 25 ms
25,936 KB
testcase_10 AC 43 ms
23,472 KB
testcase_11 AC 225 ms
27,632 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class Hello
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        if (n == 1) { Console.WriteLine("n"); goto end; }
        Console.WriteLine("a");
        for (int i = 0; i < n -2; i++)
            Console.WriteLine("a" + getS(i) + "a");
        Console.WriteLine("an" );
        end:;
    }
    public static string getS(int n)
    {
        var a = "abcdefghijklmnopqrstuvwxyz";
        var ans = new char[4];
        for (int i = 0; i < 4; i++)
        {
            ans[i] = a[n % 26];
            n /= 26;
        }
        return new string(ans);
    }
}
0