-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShenxinfu.py
More file actions
66 lines (56 loc) · 1.56 KB
/
Shenxinfu.py
File metadata and controls
66 lines (56 loc) · 1.56 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
def search(n, prev_string):
if n <= 3:
return int(prev_string[n - 1])
i = len(prev_string)
prev_string = ''.join(map(str, prev_string))
while True:
new_num = sum(map(int, list(prev_string[-3:])))
i += len(str(new_num))
if i >= n:
return str(new_num)[-(i - n + 1)]
string_temp = prev_string + str(new_num)
prev_string = string_temp[-3:]
'''
time = 1
user_input = [1,1,1,10]
print(search(user_input[-1], user_input[:-1]))
n,m = map(int,input().split())
phone_num = [input() for _ in range(n)]
num_clue = [input() for _ in range(m)]
for clue in num_clue:
time = 0
for num in phone_num:
if clue in num:
time += 1
print(time)
n = int(input())
path_check = [input() for _ in range(n)]
M = int(input())
authority = []
for i in range(M):
usr = input().split()
authority.append([usr[0],usr[-1]])
n = 1
path = '/mem/daemons/findme'
m = 3
authority = [['Y', '/mem/daemons/findme'],
['N', '/mem/daemons'], ['Y', '/mem']]
'''
def authoritycheck(path, authorityset):
path_level = path.split('/')
while path_level:
for authority, checkedpath in authorityset:
innerpath = '/'.join(path_level)
if innerpath == checkedpath:
return authority
path_level.pop()
return 'Unkown'
n = int(input())
path_check = [input() for _ in range(n)]
M = int(input())
authority = []
for i in range(M):
usr = input().split()
authority.append([usr[0],usr[-1]])
for path in path_check:
print(authoritycheck(path,authority))