Submission #806916
Source Code Expand
n = gets.chomp
#a = Array.new(2n)
line = gets.chomp
pits = line.split(" ")
pits.map!{|a| a.to_i}
spits = pits.sort_by{|i| -i}
#p spits
res = 0
i = 1
while i < spits.size
res += spits[i]
i += 2
end
puts res
Submission Info
| Submission Time | |
|---|---|
| Task | A - BBQ Easy |
| User | yokkun_s |
| Language | Ruby (2.3.3) |
| Score | 200 |
| Code Size | 224 Byte |
| Status | AC |
| Exec Time | 16 ms |
| Memory | 1788 KiB |
Compile Error
./Main.rb:1: warning: assigned but unused variable - n
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample-01.txt, sample-02.txt |
| All | sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01-01.txt | AC | 16 ms | 1788 KiB |
| 01-02.txt | AC | 16 ms | 1788 KiB |
| 01-03.txt | AC | 16 ms | 1788 KiB |
| 01-04.txt | AC | 16 ms | 1788 KiB |
| 01-05.txt | AC | 16 ms | 1788 KiB |
| 01-06.txt | AC | 16 ms | 1788 KiB |
| 01-07.txt | AC | 16 ms | 1788 KiB |
| 01-08.txt | AC | 16 ms | 1788 KiB |
| sample-01.txt | AC | 16 ms | 1788 KiB |
| sample-02.txt | AC | 16 ms | 1788 KiB |