牛客969573159号
牛客969573159号
全部文章
题解
归档
标签
去牛客网
登录
/
注册
牛客969573159号的博客
全部文章
/ 题解
(共44篇)
题解 | #查找兄弟单词#
while True: try: #读取输入数据,并且转换为列表 data1 = input().split() #获取单词的个数 n1 = data1[0] #按字典排序的第几个兄弟词 n2 =...
Python3
2021-09-24
82
5197
题解 | #简单密码#
out = [] list1 = ['0','1','2','3','4','5','6','7','8','9'] while True: try: x1 = input() for word in x1: if word in li...
Python3
2021-09-22
0
549
题解 | #简单密码#
out = [] list1 = ['0','1','2','3','4','5','6','7','8','9'] while True: try: x1 = input() for word in x1: if word in li...
Python3
2021-09-22
1
860
题解 | #坐标移动#
list1 = input().split(';') m = 0 n = 0 list2 = ['A','S','W','D'] for word in list1: try: word[0] in list2 and int(word[1:]) in range(0,...
Python3
2021-09-22
0
319
题解 | #求int型正整数在内存中存储时1的个数#
x1 = int(input()) list = [] n = 0 while x1 >= 1: x2 = x1 % 2 list.append(x2) x1 = x1 // 2 for word in list: if word == 1: ...
Python3
2021-09-22
2
519
题解 | #字符串排序#
x1 = input() list = [] while True: try: x2 = input() list.append(x2) except: break list.sort() for word in list: ...
Python3
2021-09-22
0
398
题解 | #提取不重复的整数#
x1 = input() list1 = [] list2 = [] for word in x1[::-1]: list1.append(word) for k in list1: if k not in list2: list2.append(k) for k...
Python3
2021-09-22
0
376
题解 | #合并表记录#
x1 = int(input()) dic = {} while True: try: line = input() x2 = line.split() key = int(x2[0]) value = int(x2[1]) ...
Python3
2021-09-22
0
0
题解 | #取近似值#
x1 = eval(input()) x2 = float(x1) x3 = int(x1) #x4为小数部分 x4 = x2 - x3 if x4 >= 0.5: print(x3+1) else: print(x3)
Python3
2021-09-22
0
0
题解 | #质数因子#
import math n = int(input()) for i in range(2, int(math.sqrt(n))+1): while n % i == 0: print(i, end=' ') n = n // i if n > 2: ...
Python3
2021-09-22
222
17638
首页
上一页
1
2
3
4
5
下一页
末页