影挚
影挚
全部文章
分类
题解(166)
归档
标签
去牛客网
登录
/
注册
影挚的博客
全部文章
(共73篇)
题解 | 简单错误记录
result_li = [] result_count = {} while True: try: file_pos, row = input().split() file_name = file_pos.split('\\')[-1][-16:] ...
2026-03-13
0
4
题解 | 字符个数统计
str_lset = set(input()) ans = 0 for each in str_lset: if 0 <=ord(each)<=127: ans += 1 print(ans) 先去重,直接改为集合然后ord直接拿到ascii比较
2026-03-12
0
5
题解 | #【模板】栈#
n = int(input()) li = [] for i in range(n): inp = input() if ' ' in inp: a, b = inp.split() else: a = inp print(a, b) if a == 'push': li.append(in...
Python3
2022-04-29
0
357
题解 | #牛牛的排列数#
def mul(n): if n == 1: return 1 return n * mul(n-1) a, b = map(int, input().split()) if b > a: print(0) else: print(int(mul(a)/mul(a-b)))
Python3
2022-04-29
0
473
题解 | #牛牛的Hermite多项式#
def h(n, x): if n== 0: return 1 elif n==1: return 2 else: return 2 * x * h(n-1, x) - 2 * (n-1) * h(n-2, x) a, b = map(int, input().split()) print(h(a,...
Python3
2022-04-29
0
390
题解 | #牛牛的10类人#
n = int(input()) a = list(map(int,input().split())) for item in a: b = str(bin(item)).replace('0b', '') c, d = b.count('1'), b.count('0') if c % 2 == ...
Python3
2022-04-29
0
344
题解 | #牛牛的四叶玫瑰数#
a, b = map(int, input().split()) for i in range(a, b + 1): i = str(i) k = 0 for j in i: j = int(j) k += j * j * j * j if k == int(i): print(i, end=' '...
Python3
2022-04-29
0
351
题解 | #牛牛的替换#
li = list(input().split()) a = input() if a.count(li[1]) == 0: b = a else: for i in range(a.count(li[1])): b = a.replace(li[1], li[2]) if b.count(li[3...
Python3
2022-04-29
0
309
题解 | #牛牛的素数判断#
n = int(input()) while True: try: num = int(input()) if num in [2, 3]: print('true') continue for j in range(2, int(num ** 0.5) + 1): if num % j == 0:...
Python3
2022-04-29
0
351
题解 | #大吉大利,今晚吃鸡#
代码不难,主要需要进行数学分析,这边需要系统看一下,标记 def mul(n): if n == 1: return 2 end = 3 * mul(n - 1) + 2 return end while True: try: n = int(input()) print(mul(n)) excep...
Python3
2022-04-29
0
408
首页
上一页
1
2
3
4
5
6
7
8
下一页
末页