Submission #1942787


Source Code Expand

N, C = map(int, input().split())
L = [int(input()) for _ in range(N)]
L.sort()

l = 0
r = N - 1
check = [False for _ in range(N)]

while l < r:
    if L[l] + L[r] + 1 <= C:
        check[l] = True
        check[r] = True
        l += 1
        r -= 1
    else:
        r -= 1

ans = int(sum([0.5 if f else 1 for f in check]))
print(ans)

Submission Info

Submission Time
Task C - 収納
User poyodr
Language Python (3.4.3)
Score 300
Code Size 356 Byte
Status AC
Exec Time 241 ms
Memory 8908 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 238 ms 8780 KB
02.txt AC 241 ms 8908 KB
03.txt AC 241 ms 8648 KB
04.txt AC 233 ms 8788 KB
05.txt AC 223 ms 7700 KB
06.txt AC 200 ms 5524 KB
07.txt AC 206 ms 8596 KB
08.txt AC 239 ms 8796 KB
09.txt AC 240 ms 8904 KB
10.txt AC 203 ms 5528 KB
11.txt AC 234 ms 8908 KB
12.txt AC 235 ms 8784 KB
13.txt AC 231 ms 8248 KB
sample_01.txt AC 18 ms 3060 KB
sample_02.txt AC 17 ms 3060 KB
sample_03.txt AC 18 ms 3060 KB