python求助,只有90分(re)
  • 板块P1007 独木桥
  • 楼主Red_Cow
  • 当前回复2
  • 已保存回复2
  • 发布时间2023/10/9 21:26
  • 上次更新2023/11/2 14:44:30
查看原帖
python求助,只有90分(re)
1132411
Red_Cow楼主2023/10/9 21:26
a = int(input())#桥长
b = int(input())#人数
c = input().split()
count1 = []
count2 = []
#最小值
for i in c:
    o = int(i)
    if a - o + 1 <= o:
        count1.append(a - o + 1)
        count2.append(o)
    if a - o + 1 >= o:
        count1.append(o)
        count2.append(a - o + 1)
print(max(count1),max(count2))




2023/10/9 21:26
加载中...