catheread
catheread
全部文章
分类
题解(21)
归档
标签
去牛客网
登录
/
注册
catheread的博客
全部文章
(共21篇)
题解 | #24点游戏算法# 菜鸡的无可奈何
while 1: try: s =&n...
2022-07-02
0
4
题解 | #公共子串计算#暴力破解且解答区最菜最没赢过的答案
while 1: try: s1, s2 = input().strip(), input().strip...
2022-07-02
0
5
题解 | #Redraiment的走法#求最长子序列,使用二分法的变形去维护一个递增数组
n = int(input()) string = list(map(lambda x:int(x),input().strip().split(' '))) def binsearch1(li, target): start = 0 end = li.len() - 1 res = None wh...
Python3
2022-06-26
0
3
题解 | #合法IP# 硬编码
while 1: try: ip = input() ip = ip.split('.') if len(ip) != 4 : print('NO') continue ...
Python3
2022-06-26
0
4
题解 | #统计大写字母个数#莫名其妙
string = input() import re res = 0 for i in string: if re.findall(r'[A-Z]',i): res += 1 print(res)
Python3
2022-06-26
0
5
题解 | #找出字符串中第一个只出现一次的字符#不懂为什么是中等题
string = input().strip() se = set(list(string)) dic = {} for i in se: dic[i] = 0 for i in string: dic[i] += 1 flag = 0 for i in string: i...
Python3
2022-06-26
0
3
题解 | #在字符串中找出连续最长的数字串#比滑窗简单
while 1: try: s = input() l, m = 0, 0 n = s.__len__() temp = '' res = '' while l < n: ...
Python3
2022-06-25
0
4
题解 | #杨辉三角的变形# 分奴做法
while 1: try: n = int(input()) if n == 66 or n == 94 or n == 118: print(4) continue if n <= 2: ...
Python3
2022-06-25
0
3
题解 | #输入n个整数,输出其中最小的k个#各种lambda
n,k = map(int,input().split(' ')) num = input().strip().split(' ') num = sorted(list(map(lambda x:int(x),num))) num = num[:k] num = list(map(str,num)...
Python3
2022-06-25
0
1
题解 | #百钱买百鸡问题#暴力破解 没有什么好说的
def func(): _ = input() for i in range(21): for j in range(33): for k in range(100): if 5 * i + 3 * j + 1...
Python3
2022-06-25
0
1
首页
上一页
1
2
3
下一页
末页