結果
| 問題 |
No.564 背の順
|
| コンテスト | |
| ユーザー |
kimny
|
| 提出日時 | 2017-12-03 21:54:09 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 919 bytes |
| コンパイル時間 | 2,338 ms |
| コンパイル使用メモリ | 104,064 KB |
| 実行使用メモリ | 18,176 KB |
| 最終ジャッジ日時 | 2024-11-28 14:50:11 |
| 合計ジャッジ時間 | 2,319 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 2 WA * 7 |
コンパイルメッセージ
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];
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");
}
}
}
}
kimny