結果
| 問題 | No.564 背の順 | 
| コンテスト | |
| ユーザー |  kimny | 
| 提出日時 | 2017-12-03 21:59:21 | 
| 言語 | C#(csc) (csc 3.9.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 26 ms / 2,000 ms | 
| コード長 | 1,065 bytes | 
| コンパイル時間 | 2,910 ms | 
| コンパイル使用メモリ | 112,912 KB | 
| 実行使用メモリ | 26,116 KB | 
| 最終ジャッジ日時 | 2024-11-28 14:51:01 | 
| 合計ジャッジ時間 | 2,080 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 9 | 
コンパイルメッセージ
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;
using System.Text;
using System.Threading.Tasks;
namespace yukicoder_564 {
    class Program {
        static void Main(string[] args) {
            string[] s = Console.ReadLine().Split(' ');
            int h = int.Parse(s[0]);
            int n = int.Parse(s[1]);
            int[] H = new int[n - 1];
            for(int i = 0; i < n - 1; i++) {
                H[i] = int.Parse(Console.ReadLine());
            }
            int count = 0;
            for(int i = 0; i < n - 1; i++) {
                if (h < H[i]) {
                    count++;
                }
            }
            count++;
            if(count%10==1) {
                Console.WriteLine(count + "st");
            }else if (count % 10 == 2) {
                Console.WriteLine(count + "nd");
            }else if (count % 10 == 3) {
                Console.WriteLine(count + "rd");
            } else {
                Console.WriteLine(count + "th");
            }
            Console.ReadLine();
        }
    }
}
            
            
            
        