-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResult.py
More file actions
33 lines (25 loc) · 910 Bytes
/
Copy pathResult.py
File metadata and controls
33 lines (25 loc) · 910 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
# 결과 출력 함수
def Result(team):
# team[i][0] : i팀 인원
# team[i][1:]: i팀에게 배달 성공한 피자
team.sort()
length = len(team)
print("===========저장될 결과===========")
print('팀 수: \t\t', len(team)) # 배달에 성공한 팀 수
for i in team:
print(i[0],"명 팀:\t" ,end=" ")
for j in i[1:]:
print(j, "\t", end=" ")
print()
print("=================================")
# 결과 저장
with open("Submission.text", 'w') as f:
# 총 인원
f.write(str(length)+ "\n")
for member in team:
# i팀 인원
f.write(str(member[0])+ " ")
for i in member[1:]:
# 각 재료, 마지막에 공백이 포함된다 => 출력 형식 주의
f.write(str(i)+" ")
f.write("\n")