考勤信息
标题:考勤信息 | 时间限制:1秒 | 内存限制:262144K | 语言限制:不限
n = int(input())
ans = []
def check(s):
a = ['late', 'leaveearly']
for i in a :
for j in a:
if s.find(i + ' ' +j) != -1:
return False
elif s.find(j + ' ' + i) != -1:
return False
logs = s.split()
m = len(logs)
cnt = 0
for i in logs:
if i == 'absent':
cnt += 1
if cnt > 1:
return False
for i in range(m):
cnt = 0
for j in range(i, min(i + 7, m)):
if logs[j] in ['absent', 'leaveearly', 'late']:
cnt += 1
if cnt > 3:
return False
return True
for i in range(n):
if check(input()):
ans.append('true')
else:
ans.append('false')
print(' '.join(ans))
