結果

問題 No.564 背の順
ユーザー motimoti
提出日時 2018-05-17 21:57:19
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 364 bytes
コンパイル時間 68 ms
コンパイル使用メモリ 5,328 KB
実行使用メモリ 5,056 KB
最終ジャッジ日時 2023-09-10 22:40:37
合計ジャッジ時間 974 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
5,056 KB
testcase_01 AC 5 ms
4,892 KB
testcase_02 AC 5 ms
4,944 KB
testcase_03 WA -
testcase_04 AC 5 ms
4,896 KB
testcase_05 AC 5 ms
4,904 KB
testcase_06 AC 5 ms
4,764 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 5 ms
4,948 KB
testcase_10 AC 5 ms
4,948 KB
testcase_11 AC 5 ms
4,892 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/usr/bin/env perl

use strict;
use utf8;
use warnings;

my ($h, $_) = split(/ /, <>);
chomp $h;
my $count = 1;
while (defined(my $hi = <STDIN>)) {
  chomp $hi;
  $count += ($h < $hi) ? 1 : 0;
}
if ($count == 1) { print $count . "st\n" }
elsif ($count == 2) { print $count . "nd\n" }
elsif ($count == 3) { printf $count . "rd\n" }
else { printf $count . "th\n" }
0