-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy path1311.py
More file actions
38 lines (35 loc) · 797 Bytes
/
Copy path1311.py
File metadata and controls
38 lines (35 loc) · 797 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
while True:
s, b = [int(x) for x in input().split()]
if s == b == 0:
break
dir = 0
esq = s+1
while b:
b -= 1
l, r = [int(i) for i in input().split()]
l -= 1
r += 1
if (dir != '*') and (r > dir):
dir = r
if dir > s:
dir = '*'
if (esq != '*') and (l < esq):
esq = l
if esq < 1:
esq = '*'
print(esq, dir)
'''
l -= 1
sold = sold[:l] + [0] * (r - l) + sold[r:]
while l >= 0 and sold[l] == 0:
l -= 1
while r < s and sold[r] == 0:
r += 1
l += 1
r += 1
if l <= 0:
l = '*'
if r > s:
r = '*'
'''
print('-')