結果
問題 | No.564 背の順 |
ユーザー | phspls |
提出日時 | 2020-03-28 15:34:54 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 823 bytes |
コンパイル時間 | 4,650 ms |
コンパイル使用メモリ | 102,232 KB |
実行使用メモリ | 23,960 KB |
最終ジャッジ日時 | 2023-08-30 17:54:07 |
合計ジャッジ時間 | 6,631 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 65 ms
23,816 KB |
testcase_01 | AC | 63 ms
21,604 KB |
testcase_02 | AC | 65 ms
21,652 KB |
testcase_03 | WA | - |
testcase_04 | AC | 64 ms
23,644 KB |
testcase_05 | AC | 65 ms
21,716 KB |
testcase_06 | AC | 65 ms
21,724 KB |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | AC | 62 ms
21,612 KB |
testcase_10 | AC | 64 ms
23,960 KB |
testcase_11 | AC | 63 ms
21,648 KB |
コンパイルメッセージ
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; public class P0564 { public static void Main() { var hn = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToList(); var h = hn[0]; var n = hn[1]; var heights = new List<int>(); heights.Add(h); for(int i=1; i<n; i++) { heights.Add(int.Parse(Console.ReadLine().Trim())); } heights.Sort(); var takashi = n - heights.IndexOf(h); if (takashi < 4) { if (takashi==1) { Console.WriteLine("1st"); } else if(takashi==2) { Console.WriteLine("2nd"); } else { Console.WriteLine("3rd"); } } else { Console.WriteLine(takashi + "th"); } } }