結果
| 問題 | No.349 干支の置き物 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-16 18:15:51 |
| 言語 | Nim (2.2.6) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 368 bytes |
| 記録 | |
| コンパイル時間 | 2,837 ms |
| コンパイル使用メモリ | 76,004 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2026-03-22 01:58:01 |
| 合計ジャッジ時間 | 3,609 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 29 |
ソースコード
import sequtils,strutils,algorithm,tables let n = stdin.readLine().parseInt() var B = toSeq(newSeqWith(n,stdin.readLine()).sorted(cmp).toCountTable().values).sorted(cmp) if B.len == 1 : if B[0] <= 1 : quit "YES",0 else: quit "NO",0 while true: B = B.sorted(cmp) B[^1] -= 1 B[^2] -= 1 if B[^1] < 0 : quit "NO",0 if B[^2] == 0 and B[^1] <= 1 : quit "YES",0