电信计算机类三批


#1 判断大小写
letter = input()
if letter  in ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']:
    print("up")
else:
    print('low')

#2 根据min max字符串输入返回对应结果
s = input()
a,b = list(map(int,input().split()))
if s == "min":
    print(min(a,b))
else:
    print(max(a,b))

#3 猜拳,0>2,1>0,2>1; 也就是石头剪刀布.
# 输入T场的 bob ,alice 拥有的 0 1 2 数量;
# 输出 T 场 alice 的最大的可赢场次;
def max_wins_against_bob(num_rounds, bob_moves, alice_counts):
    bob_counts = {0: 0, 1: 0, 2: 0}
    for move in bob_moves:
        bob_counts[move] += 1
    wins_with_rock = min(alice_counts[0], bob_counts[2])
    wins_with_paper = min(alice_counts[1], bob_counts[0])
    wins_with_scissors = min(alice_counts[2], bob_counts[1])
    return wins_with_rock + wins_with_paper + wins_with_scissors
test_cases = int(input())
round_counts = []
bob_moves_list = []
alice_hand_counts = []

for _ in range(test_cases):
    round_counts.append(int(input()))
    bob_moves_list.append(list(map(int, input().split())))
    alice_hand_counts.append(list(map(int, input().split())))

for i in range(test_cases):
    print(max_wins_against_bob(round_counts[i], bob_moves_list[i], alice_hand_counts[i]))

#电信求职进展汇总##电信笔试#
全部评论

相关推荐

01-04 07:53
门头沟学院 C++
心愿便利贴:工作了以后回头再看待这个问题,从客观的视角来讲是因为每个人对自己的要求不同,学习好的人对自己的要求很高,所以觉得考不好就天塌了,认为自己学习好并且值得一份好工作的人也是一样,找不到符合自己预期的工作肯定也会觉得是侮辱,牛客上有很多名校大学生,肯定会存在这种好学生心态啊,“做题区”从来都不是贬义词,这是大部分普通人赖以生存的路径,这个有什么好嘲讽的,有“好学生心态”没有错,但是不要给自己太大的压力了
点赞 评论 收藏
分享
想run的马里奥在学...:这个学历帮你扫平百分之80的障碍,投就完了,这会找不到就等3月暑期一样能找到
点赞 评论 收藏
分享
评论
点赞
1
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务