谁来帮帮我?A34920.欢乐数组
2025-07-06 08:00:36
发布于:浙江
A34920.欢乐数组 我试了好几遍,都WA
for _ in range(int(input())):
n = int(input())
arr = list(map(int, input().split()))
total = sum(arr)
if total < n:
print(":-(")
elif total == n:
print(":-(")
else:
count_1 = arr.count(1)
if count_1 == n-1 and total == n+1:
remaining = total - count_1
if remaining == 2:
print(":-(")
else:
print("^_^")
else:
print("^_^")
望大佬们给出正确答案
这里空空如也
有帮助,赞一个