第一题100: from collections import defaultdict if __name__ == '__main__': dd = defaultdict(int) s = input() for c in s: dd[c] += 1 mod = 20210101 result = 1 for k, v in dd.items(): result *= (v + 1) result %= mod print(result) 第二题100: if __name__ == '__main__': n = int(input()) j = set() w = set() for _ in range(n): t, x = list(map(int, input().split())) if t == 0: w.add(x) else: j.add(x) if len(j) > 0: print(2 * len(j) * (len(w) + 1)) else: print(1 * (len(w) + 1))
3 1

相关推荐

只因飞飞:今日首绷
点赞 评论 收藏
分享
huo12138:校友,传奇耐面王
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务