Problem p02663 (python)

Fixed submission:
import sys
readline = sys.stdin.buffer.readline

h1, m1, h2, m2, k = map(int, readline().split())
print(60 * (h2 - h1) + m2 - m1 - k)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import sys
import datetime

H1 = int(sys.stdin.readline())
M1 = int(sys.stdin.readline())
H2 = int(sys.stdin.readline())
M2 = int(sys.stdin.readline())
K = int(sys.stdin.readline())

while not (H1 < 23 or M1 < 59 or H2 < 23 or M2 < 59):
	H1 = int(sys.stdin.readline())
	M1 = int(sys.stdin.readline())
	H2 = int(sys.stdin.readline())
	M2 = int(sys.stdin.readline())
	K = int(sys.stdin.readline())
else:
	if M2 >= M1:
		a = (H2 - H1) * 60 + M2 - M1
		print(a - K)
	if M2 < M1:
		b = (H2 - H1) * 60 + M1 - M2
		print(b - K)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import sys
import datetime

# H1 = int(sys.stdin.readline())
# M1 = int(sys.stdin.readline())
# H2 = int(sys.stdin.readline())
# M2 = int(sys.stdin.readline())
# K = int(sys.stdin.readline())

H1 = 999
M1 = 999
H2 = 999
M2 = 999
K = 999


while not (H1 < 23 or M1 < 59 or H2 < 23 or M2 < 59):
    H1 = int(sys.stdin.readline())
    M1 = int(sys.stdin.readline())
    H2 = int(sys.stdin.readline())
    M2 = int(sys.stdin.readline())
    K = int(sys.stdin.readline())
else:
    if M2 >= M1:
        a = (H2 - H1) * 60 + M2 - M1
        print(a - K)
    if M2 < M1:
        b = (H2 - H1) * 60 + M1 - M2
        print(b - K)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import sys
import datetime

# H1 = int(sys.stdin.readline())
# M1 = int(sys.stdin.readline())
# H2 = int(sys.stdin.readline())
# M2 = int(sys.stdin.readline())
# K = int(sys.stdin.readline())

H1 = 999
M1 = 999
H2 = 999
M2 = 999
K = 999


while not (0 <= H1 < 23 or 0 <= M1 < 59 or 0 <= H2 < 23 or 0 <= M2 < 59):
    H1 = int(sys.stdin.readline())
    M1 = int(sys.stdin.readline())
    H2 = int(sys.stdin.readline())
    M2 = int(sys.stdin.readline())
    K = int(sys.stdin.readline())
else:
    if M2 >= M1:
        a = (H2 - H1) * 60 + M2 - M1
        print(a - K)
    if M2 < M1:
        b = (H2 - H1) * 60 + M1 - M2
        print(b - K)

Buggy submission (verdict: Runtime Error):
import sys

# H1 = int(sys.stdin.readline())
# M1 = int(sys.stdin.readline())
# H2 = int(sys.stdin.readline())
# M2 = int(sys.stdin.readline())
# K = int(sys.stdin.readline())

H1 = 999
M1 = 999
H2 = 999
M2 = 999
K = 999


while not (0 <= H1 < 23 or 0 <= M1 < 59 or 0 <= H2 < 23 or 0 <= M2 < 59):
    H1 = int(sys.stdin.readline())
    M1 = int(sys.stdin.readline())
    H2 = int(sys.stdin.readline())
    M2 = int(sys.stdin.readline())
    K = int(sys.stdin.readline())

if M2 >= M1:
    a = (H2 - H1) * 60 + M2 - M1
    print(a - K)
if M2 < M1:
    b = (H2 - H1) * 60 + M1 - M2
    print(b - K)

Buggy submission (verdict: Runtime Error):
import sys

H1 = int(sys.stdin.readline())
M1 = int(sys.stdin.readline())
H2 = int(sys.stdin.readline())
M2 = int(sys.stdin.readline())
K = int(sys.stdin.readline())


while not (0 <= H1 < 23 or 0 <= M1 < 59 or 0 <= H2 < 23 or 0 <= M2 < 59):
	H1 = int(sys.stdin.readline())
	M1 = int(sys.stdin.readline())
	H2 = int(sys.stdin.readline())
	M2 = int(sys.stdin.readline())
	K = int(sys.stdin.readline())

if M2 >= M1:
	a = (H2 - H1) * 60 + M2 - M1
	print(a - K)
if M2 < M1:
	b = (H2 - H1) * 60 + M1 - M2
	print(b - K)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import sys
import datetime

H1 = int(sys.stdin.readline())
M1 = int(sys.stdin.readline())
H2 = int(sys.stdin.readline())
M2 = int(sys.stdin.readline())
K = int(sys.stdin.readline())


while not (0 <= H1 < 23 or 0 <= M1 < 59 or 0 <= H2 < 23 or 0 <= M2 < 59):
    H1 = int(sys.stdin.readline())
    M1 = int(sys.stdin.readline())
    H2 = int(sys.stdin.readline())
    M2 = int(sys.stdin.readline())
    K = int(sys.stdin.readline())

if M2 >= M1:
    a = (H2 - H1) * 60 + M2 - M1
    print(a - K)
if M2 < M1:
    b = (H2 - H1) * 60 + M1 - M2
    print(b - K)

Buggy submission (verdict: Runtime Error):
import sys

H1 = int(sys.stdin.readline())
M1 = int(sys.stdin.readline())
H2 = int(sys.stdin.readline())
M2 = int(sys.stdin.readline())
K = int(sys.stdin.readline())


while not (0 <= H1 < 23 and 0 <= M1 < 59 and 0 <= H2 < 23 and 0 <= M2 < 59):
    H1 = int(sys.stdin.readline())
    M1 = int(sys.stdin.readline())
    H2 = int(sys.stdin.readline())
    M2 = int(sys.stdin.readline())
    K = int(sys.stdin.readline())

if M2 >= M1:
    a = (H2 - H1) * 60 + M2 - M1
    print(a - K)
if M2 < M1:
    b = (H2 - H1) * 60 + M1 - M2
    print(b - K)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import sys
import datetime

H1 = int(sys.stdin.readline())
M1 = int(sys.stdin.readline())
H2 = int(sys.stdin.readline())
M2 = int(sys.stdin.readline())
K = int(sys.stdin.readline())


while 0 <= H1 < 23 and 0 <= M1 < 59 and 0 <= H2 < 23 and 0 <= M2 < 59:
    if M2 >= M1:
        a = (H2 - H1) * 60 + M2 - M1
        print(a - K)
        break
    if M2 < M1:
        b = (H2 - H1) * 60 + M1 - M2
        print(b - K)
        break
else:
    H1 = int(sys.stdin.readline())
    M1 = int(sys.stdin.readline())
    H2 = int(sys.stdin.readline())
    M2 = int(sys.stdin.readline())
    K = int(sys.stdin.readline())

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import sys
import datetime

H1 = int(sys.stdin.readline())
M1 = int(sys.stdin.readline())
H2 = int(sys.stdin.readline())
M2 = int(sys.stdin.readline())
K = int(sys.stdin.readline())


if not 0 <= H1 < 23 and 0 <= M1 < 59 and 0 <= H2 < 23 and 0 <= M2 < 59:
    H1 = int(sys.stdin.readline())
    M1 = int(sys.stdin.readline())
    H2 = int(sys.stdin.readline())
    M2 = int(sys.stdin.readline())
    K = int(sys.stdin.readline())

if M2 >= M1:
    a = (H2 - H1) * 60 + M2 - M1
    print(a - K)
if M2 < M1:
    b = (H2 - H1) * 60 + M1 - M2
    print(b - K)

Buggy submission (verdict: Runtime Error):
import sys

H1 = int(sys.stdin.readline())
M1 = int(sys.stdin.readline())
H2 = int(sys.stdin.readline())
M2 = int(sys.stdin.readline())
K = int(sys.stdin.readline())


while not 0 <= H1 < 23 and 0 <= M1 < 59 and 0 <= H2 < 23 and 0 <= M2 < 59:
    H1 = int(sys.stdin.readline())
    M1 = int(sys.stdin.readline())
    H2 = int(sys.stdin.readline())
    M2 = int(sys.stdin.readline())
    K = int(sys.stdin.readline())

if M2 >= M1:
    a = (H2 - H1) * 60 + M2 - M1
    print(a - K)
if M2 < M1:
    b = (H2 - H1) * 60 + M1 - M2
    print(b - K)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import sys
import datetime

H1 = int(sys.stdin.readline())
M1 = int(sys.stdin.readline())
H2 = int(sys.stdin.readline())
M2 = int(sys.stdin.readline())
K = int(sys.stdin.readline())


while not 0 <= H1 < 23 and 0 <= M1 < 59 and 0 <= H2 < 23 and 0 <= M2 < 59:
    H1 = int(sys.stdin.readline())
    M1 = int(sys.stdin.readline())
    H2 = int(sys.stdin.readline())
    M2 = int(sys.stdin.readline())
    K = int(sys.stdin.readline())

if M2 >= M1:
    a = (H2 - H1) * 60 + M2 - M1
    print(a - K)
if M2 <= M1:
    b = (H2 - H1) * 60 + M1 - M2
    print(b - K)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import sys
import datetime

H1 = int(sys.stdin.readline())
M1 = int(sys.stdin.readline())
H2 = int(sys.stdin.readline())
M2 = int(sys.stdin.readline())
K = int(sys.stdin.readline())


while not 0 <= H1 < 23 and 0 <= M1 < 59 and 0 <= H2 < 23 and 0 <= M2 < 59:
    H1 = int(sys.stdin.readline())
    M1 = int(sys.stdin.readline())
    H2 = int(sys.stdin.readline())
    M2 = int(sys.stdin.readline())
    K = int(sys.stdin.readline())

if M2 > M1:
    a = (H2 - H1) * 60 + M2 - M1
    print(a - K)
if M2 < M1:
    b = (H2 - H1) * 60 + M1 - M2
    print(b - K)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import sys
import datetime

H1 = sys.stdin.readline()
M1 = sys.stdin.readline()
H2 = sys.stdin.readline()
M2 = sys.stdin.readline()
K = sys.stdin.readline()


while not 0 <= H1 < 23 and 0 <= M1 < 59 and 0 <= H2 < 23 and 0 <= M2 < 59:
    H1 = sys.stdin.readline()
    M1 = sys.stdin.readline()
    H2 = sys.stdin.readline()
    M2 = sys.stdin.readline()
    K = sys.stdin.readline()

if M2 > M1:
    a = (H2 - H1) * 60 + M2 - M1
    print(a - K)
if M2 < M1:
    b = (H2 - H1) * 60 + M1 - M2
    print(b - K)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import readline
h1 = input()
m1 = input()
h2 = input()
m2 = input()
k = input()

Buggy submission (verdict: Runtime Error):
h1 = input()
m1 = input()
h2 = input()
m2 = input()
k = input()

Buggy submission (verdict: Runtime Error):
H1 = raw_input()
M1 = raw_input()
H2 = raw_input()
M2 = raw_input()
K = raw_input()

Buggy submission (verdict: Runtime Error):
H1 = input()
M1 = input()
H2 = input()
M2 = input()
K = input()

Buggy submission (verdict: Runtime Error):
H1 = int(raw_input())
M1 = int(raw_input())
H2 = int(raw_input())
M2 = int(raw_input())
K = int(raw_input())

Buggy submission (verdict: Runtime Error):
H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import readline
import datetime

H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())


# while not 0 <= H1 < 23 and 0 <= M1 < 59 and 0 <= H2 < 23 and 0 <= M2 < 59:
#     H1 = int(raw_input())
#     M1 = int(raw_input())
#     H2 = int(raw_input())
#     M2 = int(raw_input())
#     K = int(raw_input())
    
if M2 > M1:
    a = (H2 - H1) * 60 + M2 - M1
    print(a - K)
if M2 < M1:
    b = (H2 - H1) * 60 + M1 - M2
    print(b - K)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import readline
import datetime

H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

while not 0 <= H1 < 23 and 0 <= M1 < 59 and 0 <= H2 < 23 and 0 <= M2 < 59:
	H1 = int(input())
	M1 = int(input())
	H2 = int(input())
	M2 = int(input())
	K = int(input())
if M2 > M1:
    a = (H2 - H1) * 60 + M2 - M1
    print(a - K)
if M2 < M1:
    b = (H2 - H1) * 60 + M1 - M2
    print(b - K)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import readline
import datetime

H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

while not 0 <= H1 < 23 and 0 <= M1 < 59 and 0 <= H2 < 23 and 0 <= M2 < 59:
	H1 = int(input())
	M1 = int(input())
	H2 = int(input())
	M2 = int(input())
	K = int(input())
else:
    if M2 > M1:
        a = (H2 - H1) * 60 + M2 - M1
        print(a - K)
    else:
        M2 < M1
        b = (H2 - H1) * 60 + M1 - M2
        print(b - K)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import readline
import datetime

H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

while not 0 <= H1 < 23 and 0 <= M1 < 60 and 0 <= H2 < 23 and 0 <= M2 < 60:
	H1 = int(input())
	M1 = int(input())
	H2 = int(input())
	M2 = int(input())
	K = int(input())
else:
    if M2 > M1:
        a = (H2 - H1) * 60 + M2 - M1
        print(a - K)
    else:
        M2 < M1
        b = (H2 - H1) * 60 + M1 - M2
        print(b - K)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import readline
import datetime

H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

while 0 <= H1 < 23 and 0 <= M1 < 60 and 0 <= H2 < 23 and 0 <= M2 < 60:
    if M2 > M1:
        a = (H2 - H1) * 60 + M2 - M1
        print(a - K)
        break
    else:
        M2 < M1
        b = (H2 - H1) * 60 + M1 - M2
        print(b - K)
        break
else:
	H1 = int(input())
	M1 = int(input())
	H2 = int(input())
	M2 = int(input())
	K = int(input())

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import readline
import datetime

H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

while 0 <= H1 < 23 and 0 <= M1 < 60 and 0 <= H2 < 23 and 0 <= M2 < 60:
    if M2 > M1:
        a = (H2 - H1) * 60 + M2 - M1
        print(a - K)
    else:
        M2 < M1
        b = (H2 - H1) * 60 + M1 - M2
        print(b - K)
else:
  	H1 = int(input())
	M1 = int(input())
	H2 = int(input())
	M2 = int(input())
	K = int(input())

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import readline
import datetime

H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

while 0 <= H1 < 23 or 0 <= M1 < 60 or 0 <= H2 < 23 or 0 <= M2 < 60:
    if M2 > M1:
        a = (H2 - H1) * 60 + M2 - M1
        print(a - K)
    else:
        M2 < M1
        b = (H2 - H1) * 60 + M1 - M2
        print(b - K)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import readline
import datetime

H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

while H1 < 23 or M1 < 60 or H2 < 23 or M2 < 60:
  	H1 = int(input())
	M1 = int(input())
	H2 = int(input())
	M2 = int(input())
	K = int(input())
else:
    if M2 > M1:
        a = (H2 - H1) * 60 + M2 - M1
        print(a - K)
    else:
        M2 < M1
        b = (H2 - H1) * 60 + M1 - M2
        print(b - K)

Buggy submission (verdict: Runtime Error):
H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

while H1 > 23 or M1 > 60 or H2 > 23 or M2 > 60:
	H1 = int(input())
	M1 = int(input())
	H2 = int(input())
	M2 = int(input())
	K = int(input())
else:
    if M2 > M1:
        a = (H2 - H1) * 60 + M2 - M1
        print(a - K)
    else:
        M2 < M1
        b = (H2 - H1) * 60 + M1 - M2
        print(b - K)

Buggy submission (verdict: Runtime Error):
import readline
import datetime

get_time = int(input())
get_minute = int(input())
sleep_time = int(input())
sleep_minute = int(input())
study = int(input())

while get_time > 23 or get_minute > 60 or sleep_time > 23 or sleep_minute > 60:
  	get_time = int(input())
	get_minute = int(input())
	sleep_time = int(input())
	sleep_minute = int(input())
	study = int(input())
else:
    if sleep_minute > get_minute:
        a = (sleep_time - get_time) * 60 + sleep_minute - get_minute
        print(a - study)
    else:
        sleep_minute < get_minute
        b = (sleep_time - get_time) * 60 + get_minute - sleep_minute
        print(b - study)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import readline
import datetime

get_time = int(input())
get_minute = int(input())
sleep_time = int(input())
sleep_minute = int(input())
study = int(input())

a = (sleep_time - get_time) * 60 + sleep_minute - get_minute
print(a - study)