Submission #242055


Source Code Expand

Copy
niku = [0,0,0,0]
n = gets.to_i

n.times do |i|
	niku[i] = gets.to_i
end

niku.sort!

if niku[3] >= niku[1] + niku[2] + niku[0]
	puts niku[3]
elsif niku[3] <= niku[1] + niku[2] + niku[0]
	puts niku[1] + niku[2] + niku[0]
elsif niku[0] + niku[3] >= niku[1] + niku[2]
	puts niku[0] + niku[3]
elsif
	puts niku[1] + niku[2]
end

Submission Info

Submission Time
Task A - 高橋君とお肉
User cocoa_dahlia
Language Ruby (1.9.3)
Score 0
Code Size 339 Byte
Status
Exec Time 41 ms
Memory 2540 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 subtask0-sample-01.txt, subtask0-sample-02.txt, subtask0-sample-03.txt
All 0 / 100 subtask0-sample-01.txt, subtask0-sample-02.txt, subtask0-sample-03.txt, subtask1-01.txt, subtask1-02.txt, subtask1-03.txt, subtask1-04.txt, subtask1-05.txt, subtask1-06.txt, subtask1-07.txt, subtask1-08.txt, subtask1-09.txt, subtask1-10.txt, subtask1-11.txt, subtask1-12.txt, subtask1-13.txt, subtask1-14.txt, subtask1-15.txt, subtask1-16.txt
Case Name Status Exec Time Memory
subtask0-sample-01.txt 40 ms 2532 KB
subtask0-sample-02.txt 38 ms 2536 KB
subtask0-sample-03.txt 38 ms 2536 KB
subtask1-01.txt 38 ms 2532 KB
subtask1-02.txt 39 ms 2536 KB
subtask1-03.txt 39 ms 2536 KB
subtask1-04.txt 39 ms 2540 KB
subtask1-05.txt 38 ms 2540 KB
subtask1-06.txt 40 ms 2536 KB
subtask1-07.txt 38 ms 2532 KB
subtask1-08.txt 39 ms 2536 KB
subtask1-09.txt 39 ms 2496 KB
subtask1-10.txt 39 ms 2536 KB
subtask1-11.txt 39 ms 2536 KB
subtask1-12.txt 39 ms 2532 KB
subtask1-13.txt 39 ms 2536 KB
subtask1-14.txt 41 ms 2532 KB
subtask1-15.txt 39 ms 2536 KB
subtask1-16.txt 40 ms 2536 KB