Submission #242494


Source Code Expand

Copy
niku = []
n = gets.to_i

n.times do |i|
	niku << gets.to_i
end

sum = niku.inject(:+) / 2


nikuyaki = []
niku.count.times{|i|
	sumTime = niku.combination(i+1).to_a
	sumTime.count.times{|j|
		time = sumTime[j].inject(:+)
		if time > sum
			nikuyaki << time
		end
	}
}

nikuyaki.sort!
puts nikuyaki[0]

Submission Info

Submission Time
Task A - 高橋君とお肉
User cocoa_dahlia
Language Ruby (1.9.3)
Score 100
Code Size 324 Byte
Status
Exec Time 59 ms
Memory 4216 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 100 / 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 58 ms 4208 KB
subtask0-sample-02.txt 57 ms 4212 KB
subtask0-sample-03.txt 56 ms 4212 KB
subtask1-01.txt 56 ms 4212 KB
subtask1-02.txt 57 ms 4208 KB
subtask1-03.txt 57 ms 4208 KB
subtask1-04.txt 57 ms 4212 KB
subtask1-05.txt 57 ms 4212 KB
subtask1-06.txt 55 ms 4208 KB
subtask1-07.txt 56 ms 4208 KB
subtask1-08.txt 56 ms 4208 KB
subtask1-09.txt 57 ms 4204 KB
subtask1-10.txt 59 ms 4208 KB
subtask1-11.txt 56 ms 4208 KB
subtask1-12.txt 57 ms 4216 KB
subtask1-13.txt 57 ms 4212 KB
subtask1-14.txt 55 ms 4212 KB
subtask1-15.txt 56 ms 4212 KB
subtask1-16.txt 57 ms 4212 KB