結果
問題 |
No.564 背の順
|
ユーザー |
![]() |
提出日時 | 2018-05-30 01:04:58 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 485 bytes |
コンパイル時間 | 916 ms |
コンパイル使用メモリ | 117,192 KB |
実行使用メモリ | 27,380 KB |
最終ジャッジ日時 | 2024-06-30 08:09:08 |
合計ジャッジ時間 | 1,951 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 WA * 2 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Linq; class No564{ static void Main(string[] args){ string[] str=(Console.ReadLine()).Split(' '); int[] i=str.Select(t=>Int32.Parse(t)).ToArray(); var num=i[1]-1; var count=0; for(int j=0;j<num;++j){ if((i[0]-(Int32.Parse(Console.ReadLine())))<0) count++; } var c=(count+1)%10; var s=(c>3)?"th":(c==3)?"rd":(c==2)?"nd":"st"; Console.WriteLine($"{count+1}{s}"); } }