結果

問題 No.2246 1333-like Number
ユーザー bluemeganebluemegane
提出日時 2023-03-18 07:25:25
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 649 bytes
コンパイル時間 928 ms
コンパイル使用メモリ 106,852 KB
実行使用メモリ 23,944 KB
最終ジャッジ日時 2023-10-18 17:05:50
合計ジャッジ時間 3,553 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
23,944 KB
testcase_01 AC 23 ms
23,944 KB
testcase_02 AC 22 ms
23,944 KB
testcase_03 AC 22 ms
23,944 KB
testcase_04 AC 108 ms
23,944 KB
testcase_05 AC 77 ms
23,944 KB
testcase_06 AC 86 ms
23,944 KB
testcase_07 AC 93 ms
23,944 KB
testcase_08 AC 47 ms
23,944 KB
testcase_09 AC 79 ms
23,944 KB
testcase_10 AC 45 ms
23,944 KB
testcase_11 AC 75 ms
23,944 KB
testcase_12 AC 29 ms
23,944 KB
testcase_13 AC 39 ms
23,944 KB
testcase_14 AC 51 ms
23,944 KB
testcase_15 AC 50 ms
23,944 KB
testcase_16 AC 66 ms
23,944 KB
testcase_17 AC 91 ms
23,944 KB
testcase_18 AC 37 ms
23,944 KB
testcase_19 AC 42 ms
23,944 KB
testcase_20 AC 104 ms
23,944 KB
testcase_21 AC 86 ms
23,944 KB
testcase_22 AC 69 ms
23,944 KB
testcase_23 AC 107 ms
23,944 KB
testcase_24 AC 100 ms
23,944 KB
testcase_25 AC 23 ms
23,944 KB
testcase_26 AC 107 ms
23,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System.Collections.Generic;
using System;

public class Hello
{
    static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        getAns(n);
    }
    static void getAns(int n)
    {
        var a = new List<int>();
        for (int i = 1; i <= 8; i++)
            for (int j = i + 1; j <= 9; j++) a.Add(i * 10 + j);
        if (n <= 36) { Console.WriteLine(a[n - 1]); return; }
        var s = (n-1) / 36;
        var r = n % 36;
        if (r - 1 < 0) r += 36;
        Console.Write(a[r - 1]);
        var c = a[r - 1] % 10;
        for (int i = 0; i < s; i++) Console.Write(c);
        Console.WriteLine();
    }
}
0