牛客404425958号
牛客404425958号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客404425958号的博客
全部文章
(共214篇)
题解 | #记负均正#
n=int(input()) nums=list(map(int,input().split())) #print(nums) neg_n=0 pos=[] for i in nums: if i<0: neg_n += 1 elif i>0: ...
2024-11-11
0
33
题解 | #表示数字#
#print(ord('A'),ord('0')) ''' s=list(input()) s1='' pre_s='' for i in s: if i.isdigit(): if pre_s.isdigit()==0: s1 += '*' ...
2024-11-11
0
34
题解 | #记票统计# list.count(i)
''' n1=int(input()) candidate=input().split() candidate.append('Invalid') n2=int(input()) vote=input().split() #print(candidate,vote) ticket_cnt={} n_...
2024-11-11
0
37
题解 | #走方格的方案数#
'''n*m 棋盘:走到左下角=走到左下角上方点+走到左下角左方点,即 f(n,m)=f(n-1,m)+f(n,m-1) ''' def f(n,m): if n==0 or m==0: # 递归过程到最后,n或m归于0(基本取值),需说明此时的函数取值,否则无法得出结...
2024-11-10
0
36
题解 | #密码强度等级#
def Score(s): score=0 # 密码长度得分 if len(s)<=4: score += 5 elif 5<=len(s)<=7: score += 10 elif len(s)>=8...
2024-11-10
0
48
题解 | #密码强度等级# 好多if elif。。。。。。。
def Score(s): score=0 # 密码长度得分 if len(s)<=4: score += 5 elif 5<=len(s)<=7: score += 10 elif len(s)>=8...
2024-11-10
0
56
题解 | #求最大连续bit数#
while 1: try: n=int(input()) binary='' while n//2 != 0: binary += str(n%2) n = n//2 binary...
2024-11-10
0
40
题解 | #最长回文子串#
''' a='gsdgdaber' print(len(a),a[4:7]) for i in range(len(a)): for j in range(i+1,len(a)): print(type(i),type(j)) string_cut=a[i:j...
2024-11-10
0
39
题解 | #统计大写字母个数#
while 1: try: string=input() cnt=0 for i in string: if 65<=ord(i)<=90: cnt += 1 ...
2024-11-10
0
39
题解 | #二维数组操作#
while 1: try: size=input().split() m,n=int(size[0]),int(size[1]) if m>9 or n>9: print(-1) else: ...
2024-11-10
0
75
首页
上一页
4
5
6
7
8
9
10
11
12
13
下一页
末页