牛客248819649号
牛客248819649号
全部文章
题解
归档
标签
去牛客网
登录
/
注册
牛客248819649号的博客
全部文章
/ 题解
(共7篇)
题解 | #输入n个整数,输出其中最小的k个#
num1 = int(input()) num2 = [int(i) for i in input().split()] num3 = int(input()) if num3 == 0: print(' '.join(map(str, sorted(num2)))) i...
Python3
2022-03-16
1
270
题解 | #输入n个整数,输出其中最小的k个#
while True: try: opt = input().split() n = int(opt[1]) &nbs...
Python3
2022-03-16
0
150
题解 | #取近似值#
opt = input() a = int(opt.split(".")[0]) b = opt.split(".")[1] lst = [] for i in b: lst.append(int(i)) if lst[0] >= 5: ...
Python3
2022-03-15
0
191
题解 | #找出字符串中第一个只出现一次的字符#
lst = input() lst2 = [] for i in lst: if lst.count(i) == 1: lst2.append(i) print...
Python3
2022-03-11
0
140
题解 | #图片整理#
a = input() lst = [] for i in a: lst.append(ord(i)) list2 = [] for i in sorted(lst): list2.append(chr(i)) print(''.join(li...
Python3
2022-03-04
0
178
题解 | #单词倒排#
a = input() for i in a: if not i.isalpha(): #判断是否为字母 a = a.replace(i, ' ') #将非字母替换为空格 b = a.split() print(' ...
Python3
2022-03-04
0
175
题解 | #删除字符串中出现次数最少的字符#
a = input() dic = {} lst = [] for i in a: if i not in dic: dic[i] = 1 else: &nbs...
Python3
2022-03-04
0
140