| Task: | Binge watching |
| Sender: | aalto25b_004 |
| Submission time: | 2025-09-10 16:28:06 +0300 |
| Language: | Python3 (PyPy3) |
| Status: | READY |
| Result: | RUNTIME ERROR |
| test | verdict | time | |
|---|---|---|---|
| #1 | RUNTIME ERROR | 0.06 s | details |
| #2 | RUNTIME ERROR | 0.07 s | details |
| #3 | RUNTIME ERROR | 0.06 s | details |
| #4 | RUNTIME ERROR | 0.07 s | details |
| #5 | RUNTIME ERROR | 0.06 s | details |
| #6 | RUNTIME ERROR | 0.06 s | details |
| #7 | RUNTIME ERROR | 0.06 s | details |
| #8 | RUNTIME ERROR | 0.07 s | details |
| #9 | RUNTIME ERROR | 0.06 s | details |
Code
def max_apartments(n, m, k, applicants, apartments):
applicants.sort()
apartments.sort()
i = 0 # pointer for applicants
j = 0 # pointer for apartments
count = 0
while i < n and j < m:
if apartments[j] < applicants[i] - k:
j += 1
elif apartments[j] > applicants[i] + k:
i += 1
else:
count += 1
i += 1
j += 1
return count
def main():
# Example usage
n, m, k = map(int, input().split())
applicants = list(map(int, input().split()))
apartments = list(map(int, input().split()))
result = max_apartments(n, m, k, applicants, apartments)
print(result)
if __name__ == "__main__":
main()Test details
Test 1
Verdict: RUNTIME ERROR
| input |
|---|
| 10 6 7 4 5 8 9 2 3 ... |
| correct output |
|---|
| 10 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 34, in <module>
main()...Test 2
Verdict: RUNTIME ERROR
| input |
|---|
| 10 1 1000 1 1000 1 1000 1 1000 ... |
| correct output |
|---|
| 1 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 34, in <module>
main()...Test 3
Verdict: RUNTIME ERROR
| input |
|---|
| 10 404 882 690 974 201 255 800 933 ... |
| correct output |
|---|
| 4 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 34, in <module>
main()...Test 4
Verdict: RUNTIME ERROR
| input |
|---|
| 200000 177494 177495 157029 157030 6030 6031 15209 15210 ... |
| correct output |
|---|
| 200000 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 34, in <module>
main()...Test 5
Verdict: RUNTIME ERROR
| input |
|---|
| 200000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 ... |
| correct output |
|---|
| 1 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 34, in <module>
main()...Test 6
Verdict: RUNTIME ERROR
| input |
|---|
| 200000 82334756 323555178 958182284 981100325 649818003 678160906 801994655 889397498 ... |
| correct output |
|---|
| 725 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 34, in <module>
main()...Test 7
Verdict: RUNTIME ERROR
| input |
|---|
| 3 1 1000 2 3 5 6 |
| correct output |
|---|
| 2 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 34, in <module>
main()...Test 8
Verdict: RUNTIME ERROR
| input |
|---|
| 3 3 4 5 6 7 8 |
| correct output |
|---|
| 3 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 34, in <module>
main()...Test 9
Verdict: RUNTIME ERROR
| input |
|---|
| 2 1 2 3 4 |
| correct output |
|---|
| 2 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 34, in <module>
main()...