牛客511199982号
牛客511199982号
全部文章
分类
题解(33)
归档
标签
去牛客网
登录
/
注册
牛客511199982号的博客
全部文章
(共26篇)
题解 | #输入n个整数,输出其中最小的k个#
while True: try: n1,n2 = list(map(int,input().split())) value = sorted(list(map(int,input().split()))) #print() print(*value[:n2]) except: break
Python3
2021-12-10
0
304
题解 | #整型数组合并#
while True: try: num1 = int(input()) value1 = list(map(int,input().split())) num2 = int(input()) value2 = list(map(int,input().split())) result = valu...
Python3
2021-12-10
0
280
题解 | #密码强度等级#
def lens(s): if len(s) <= 4: return 5 elif 5 <= len(s) <= 7: return 10 elif len(s) >= 8: return 25 def zimu(a,b): if a == 0 and b > 0: ...
Python3
2021-12-10
0
313
题解 | #查找两个字符串a,b中的最长公共子串#
while True: try: s1 = input() s2 = input() index = len(s2) result = '' #结果,动态判断替换 if len(s1) < len(s2): s1,s2 = s2,s1 #s1存长的,s2存短的 for a in range...
Python3
2021-12-10
0
316
题解 | #字符串排序#
while True: try: s = input() a = '' #剔除符号后的字符串 d = '' #结果 for i in s: if i.isalpha(): a += i news = sorted(a,key=str.lower) for i in range(len(s)): if...
Python3
2021-12-10
0
270
题解 | #参数解析#
while True: try: str_list = input() new_list = [] if r'"' not in str_list: new_list = str_list.split() else: a = str_l...
Python3
2021-12-09
1
285
题解 | #从单向链表中删除指定值的节点#
while True: try: s = list(map(int,input().split())) last = [s[1]] #最终顺序列表 for i in range(0,s[0]*2-2,2): index = last.index(s[3+i]) # print(s[3+i]) la...
Python3
2021-12-09
0
259
题解 | #名字的漂亮度#
import string n = int(input()) while True: try: s = input().lower() lows = string.ascii_lowercase result = [] out = 0 for i in lows: c = s.count(i) if...
Python3
2021-12-09
0
280
题解 | #字符串加密#
import string def func(a,i): list_str = list(a) list_str.pop(i) newstr = ''.join(list_str) return newstr while True: try: data1 = input() data2 = inpu...
Python3
2021-12-09
0
264
题解 | #简单密码#
def fun1(value, i): for k in value: if i in k: return k[0] return 0 while True: try: s = input() result = '' value = ['2abc', '3def', '4ghi', '5jkl', ...
Python3
2021-12-09
0
183
首页
上一页
1
2
3
下一页
末页