結果
| 問題 | No.112 ややこしい鶴亀算 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-05-25 17:17:03 |
| 言語 | Ruby (4.0.2) |
| 結果 |
AC
|
| 実行時間 | 53 ms / 5,000 ms |
| コード長 | 389 bytes |
| 記録 | |
| コンパイル時間 | 189 ms |
| コンパイル使用メモリ | 9,216 KB |
| 実行使用メモリ | 14,976 KB |
| 最終ジャッジ日時 | 2026-04-08 07:24:40 |
| 合計ジャッジ時間 | 2,333 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
コンパイルメッセージ
Syntax OK
ソースコード
n=gets.to_i
animals = gets.split.map(&:to_i)
if animals.max == animals.min then
if animals[0]/(n-1)==2 then
tsuru=n
kame=0
end
if animals[0]/(n-1)==4 then
tsuru=0
kame=n
end
else
tsuru=animals.count(animals.max)
kame=animals.count(animals.min)
end
puts "#{tsuru}\s#{kame}"