結果
| 問題 |
No.2126 MEX Game
|
| コンテスト | |
| ユーザー |
siman
|
| 提出日時 | 2022-11-20 07:14:58 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 327 bytes |
| コンパイル時間 | 168 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 24,832 KB |
| 最終ジャッジ日時 | 2024-09-21 09:21:56 |
| 合計ジャッジ時間 | 4,914 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 WA * 5 |
コンパイルメッセージ
Syntax OK
ソースコード
N = gets.to_i
A = gets.split.map(&:to_i)
C = A.tally
C.default = 0
ans = 0
0.upto(A.max) do |a|
has_three = true if C[a] >= 3
if C[a] <= 1
if C[a] == 1
if has_three
ans += 1
elsif (a + 1..A.max).any? { |x| C[x] >= 1 }
ans += 1
end
end
break
end
ans += 1
end
puts ans
siman