Submission details
Task:Binge watching
Sender:aalto26bw_002
Submission time:2026-09-09 17:01:09 +0300
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#10.06 sdetails
#20.06 sdetails
#30.06 sdetails
#40.13 sdetails
#50.13 sdetails
#60.14 sdetails
#70.06 sdetails
#80.06 sdetails
#90.06 sdetails

Code

import sys
def max_movies():
    entry = sys.stdin.read().split()
    n = int(entry)
    movies = []
    idx = 1

    for _ in range(n):
        start_time = int(entry[idx])
        end_time = int(entry[idx+1])
        movies.append((start_time, end_time))
        idx += 2
#ending
    movies.sort(key=lambda x: x)
    count = 0
    last_end_time = -1
    
    for start_time, end_time in movies:
        if start_time >= last_end_time:
            count += 1
            last_end_time = end_time
    
    print(count)

max_movies()

Test details

Test 1

Verdict:

input
10
6 7
4 5
8 9
2 3
...

correct output
10

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    max_movies()
  File "/box/input/code.py", line 4, in max_movies
    n = int(entry)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'

Test 2

Verdict:

input
10
1 1000
1 1000
1 1000
1 1000
...

correct output
1

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    max_movies()
  File "/box/input/code.py", line 4, in max_movies
    n = int(entry)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'

Test 3

Verdict:

input
10
404 882
690 974
201 255
800 933
...

correct output
4

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    max_movies()
  File "/box/input/code.py", line 4, in max_movies
    n = int(entry)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'

Test 4

Verdict:

input
200000
177494 177495
157029 157030
6030 6031
15209 15210
...

correct output
200000

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    max_movies()
  File "/box/input/code.py", line 4, in max_movies
    n = int(entry)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'

Test 5

Verdict:

input
200000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
...

correct output
1

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    max_movies()
  File "/box/input/code.py", line 4, in max_movies
    n = int(entry)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'

Test 6

Verdict:

input
200000
82334756 323555178
958182284 981100325
649818003 678160906
801994655 889397498
...

correct output
725

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    max_movies()
  File "/box/input/code.py", line 4, in max_movies
    n = int(entry)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'

Test 7

Verdict:

input
3
1 1000
2 3
5 6

correct output
2

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    max_movies()
  File "/box/input/code.py", line 4, in max_movies
    n = int(entry)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'

Test 8

Verdict:

input
3
3 4
5 6
7 8

correct output
3

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    max_movies()
  File "/box/input/code.py", line 4, in max_movies
    n = int(entry)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'

Test 9

Verdict:

input
2
1 2
3 4

correct output
2

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    max_movies()
  File "/box/input/code.py", line 4, in max_movies
    n = int(entry)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'