-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathService Lane.py
More file actions
41 lines (29 loc) · 777 Bytes
/
Copy pathService Lane.py
File metadata and controls
41 lines (29 loc) · 777 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
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the serviceLane function below.
def serviceLane(n, cases, width):
print(n)
print(cases)
print(width)
results=[]
for each in cases:
print((width[each[0]:each[1]+1]))
results.append(min(width[each[0]:each[1]+1]))
return results
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
nt = input().split()
n = int(nt[0])
t = int(nt[1])
width = list(map(int, input().rstrip().split()))
cases = []
for _ in range(t):
cases.append(list(map(int, input().rstrip().split())))
result = serviceLane(n, cases, width)
fptr.write('\n'.join(map(str, result)))
fptr.write('\n')
fptr.close()