牛客248819649号
牛客248819649号
全部文章
题解
归档
标签
去牛客网
登录
/
注册
牛客248819649号的博客
全部文章
/ 题解
(共9篇)
题解 | #输入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
255
题解 | #输入n个整数,输出其中最小的k个#
while True: try: opt = input().split() n = int(opt[1]) &nbs...
Python3
2022-03-16
0
136
题解 | #取近似值#
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
177
题解 | #找出字符串中第一个只出现一次的字符#
lst = input() lst2 = [] for i in lst: if lst.count(i) == 1: lst2.append(i) print...
Python3
2022-03-11
0
125
题解 | #图片整理#
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
163
题解 | #单词倒排#
a = input() for i in a: if not i.isalpha(): #判断是否为字母 a = a.replace(i, ' ') #将非字母替换为空格 b = a.split() print(' ...
Python3
2022-03-04
0
163
题解 | #删除字符串中出现次数最少的字符#
a = input() dic = {} lst = [] for i in a: if i not in dic: dic[i] = 1 else: &nbs...
Python3
2022-03-04
0
134
题解 | #求int型正整数在内存中存储时1的个数#
def one_test(num): result = bin(num).replace("0b", "") return result.count("1") print one_test(5)
2021-07-22
0
261
题解 | #求int型正整数在内存中存储时1的个数#
def one_test(num): result = bin(num).replace("0b", "") return result.count("1") print one_test(5)
2021-07-22
1
302