Submission #2835504


Source Code Expand

n, c = map(int, input().split())
l = sorted([int(input()) for _ in range(n)])
if n == 1:
  print(1)
else:
  i = 0
  j = n - 1
  ans = 0
  while i < j:
    if l[i] + l[j] <= c - 1:
      ans += 1
      i += 1
      j -= 1
    else:
      ans += 1
      j -= 1
  if i == j:
    ans += 1
  print(ans)

Submission Info

Submission Time
Task C - 収納
User anagohirame
Language Python (3.4.3)
Score 300
Code Size 317 Byte
Status AC
Exec Time 231 ms
Memory 8284 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 222 ms 8276 KB
02.txt AC 230 ms 8276 KB
03.txt AC 231 ms 8012 KB
04.txt AC 230 ms 8284 KB
05.txt AC 201 ms 7012 KB
06.txt AC 201 ms 4684 KB
07.txt AC 189 ms 7828 KB
08.txt AC 219 ms 8272 KB
09.txt AC 221 ms 8272 KB
10.txt AC 195 ms 4648 KB
11.txt AC 217 ms 8272 KB
12.txt AC 230 ms 8152 KB
13.txt AC 216 ms 7628 KB
sample_01.txt AC 17 ms 3060 KB
sample_02.txt AC 17 ms 3060 KB
sample_03.txt AC 17 ms 3060 KB