Submission #3449730


Source Code Expand

N, C = list(map(int, input().split()))

L = []

for i in range(N):
	L.append(int(input()))

L = sorted(L)

n = N
c = 0
while n >= 2:
	b = L[-1]
	del L[-1]
	n -= 1

	a = L[0]
	if a + b + 1 <= C:
		del L[0]
		n -= 1
	c += 1

if n == 1:
	c += 1

print(c)

Submission Info

Submission Time
Task C - 収納
User su_565fx
Language Python (3.4.3)
Score 300
Code Size 276 Byte
Status AC
Exec Time 1001 ms
Memory 8280 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 16
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
01.txt AC 988 ms 8276 KB
02.txt AC 1000 ms 8280 KB
03.txt AC 833 ms 8028 KB
04.txt AC 1001 ms 8276 KB
05.txt AC 981 ms 6904 KB
06.txt AC 217 ms 4628 KB
07.txt AC 935 ms 7848 KB
08.txt AC 982 ms 8164 KB
09.txt AC 994 ms 8264 KB
10.txt AC 231 ms 4648 KB
11.txt AC 988 ms 8276 KB
12.txt AC 983 ms 8152 KB
13.txt AC 990 ms 7648 KB
sample_01.txt AC 17 ms 3064 KB
sample_02.txt AC 17 ms 3060 KB
sample_03.txt AC 17 ms 3060 KB