-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbreaking_records.py
More file actions
47 lines (32 loc) · 895 Bytes
/
Copy pathbreaking_records.py
File metadata and controls
47 lines (32 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import math
import os
import random
import re
import sys
def breakingRecords(scores):
# Write your code here
score =0
highest_score=0
lowest_score = 0
min_count = 0
max_count = 0
for i in range(0, len(scores)):
score = scores[i]
if i == 0:
highest_score = score
lowest_score = score
if highest_score < score:
highest_score = score
max_count += 1
if lowest_score > score:
lowest_score = score
min_count += 1
return (max_count, min_count)
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
n = int(input().strip())
scores = list(map(int, input().rstrip().split()))
result = breakingRecords(scores)
fptr.write(' '.join(map(str, result)))
fptr.write('\n')
fptr.close()