結果

問題 No.564 背の順
ユーザー huffman56huffman56
提出日時 2023-01-14 10:03:05
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 979 bytes
コンパイル時間 3,845 ms
コンパイル使用メモリ 101,820 KB
実行使用メモリ 23,836 KB
最終ジャッジ日時 2023-08-26 16:44:47
合計ジャッジ時間 5,136 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
21,740 KB
testcase_01 AC 53 ms
21,768 KB
testcase_02 AC 55 ms
21,920 KB
testcase_03 WA -
testcase_04 AC 55 ms
21,968 KB
testcase_05 AC 54 ms
23,788 KB
testcase_06 AC 52 ms
23,804 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 54 ms
21,916 KB
testcase_10 AC 53 ms
21,748 KB
testcase_11 AC 56 ms
23,688 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Numerics;

namespace _0446
{
    class Program
    {
        static void Main(string[] args)
        {
            var x = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var h = x[0];
            var n = x[1];
            var cnt = 0;

            for (var i = 0; i < n-1; i++)
            {
                var chk = int.Parse(Console.ReadLine());

                if (h < chk)
                {
                    cnt++;
                }
            }

            if (cnt+1 == 1)
            {
                Console.WriteLine("1st");
            }
            else if (cnt + 1 == 2)
            {
                Console.WriteLine("2nd");
            }
            else if (cnt + 1 == 3)
            {
                Console.WriteLine("3rd");
            }
            else
            {
                Console.WriteLine(cnt+1 + "th");
            }

        }
    }
}
0