派仔
派仔
全部文章
分类
题解(68)
归档
标签
去牛客网
登录
/
注册
Lincs
Do more, know more, be more
全部文章
(共149篇)
题解 | #汽水瓶#
import sys def f(n): if n <= 1: return 0 if n == 2: return 1 return n//3 + f(n//3 + n%3) for line in sys.stdin: ...
2023-03-29
1
209
题解 | #简单密码#
line = input() d = {"abc": 2, "def": 3, "ghi": 4, "jkl": 5, "mno": 6, "pqrs": 7, "tuv": 8, "wxyz": 9} ans = "" for ch in line: if ch.isdigit(): ...
2023-03-29
1
214
题解 | #密码验证合格程序#
import sys def check(line): # 长度超过8位 if len(line) <= 8: return False # 包括大小写字母.数字.其它符号,以上四种至少三种 upper, lower, number, oth...
2023-03-29
1
235
题解 | #简单错误记录#
from collections import defaultdict import sys d = defaultdict(int) # 循环记录,只输出最后出现的八条错误记录 record = [] for line in sys.stdin: line = line.strip()...
2023-03-29
1
189
题解 | #识别有效的IP地址和掩码并进行分类统计#
import sys def valid_ip(ip): for s in ip: if len(s) == 0 or int(s) > 255 or int(s) < 0: return False return True d...
2023-03-29
1
264
题解 | #坐标移动#
actions = input().split(";") x, y = 0, 0 for action in actions: if len(action) < 2 or len(action) > 3: continue try: num...
2023-03-28
1
219
题解 | #购物单#
from collections import defaultdict line = input().split(" ") # 除以10是必须的,不然会超时 N = int(line[0]) // 10 m = int(line[1]) prices = defaultdict(lambda: [...
2023-03-28
1
209
题解 | #求int型正整数在内存中存储时1的个数#
num = int(input()) count = 0 while num != 0: if num % 2 == 1: count += 1 num //= 2 print(count)
2023-03-28
1
240
题解 | #字符串排序#
n = int(input()) arr = [] for i in range(n): arr.append(input()) arr.sort() for word in arr: print(word)
2023-03-28
1
178
题解 | #句子逆序#
string = input() words = string.split(' ') ans = "" for word in words[::-1]: ans += word + " " print(ans)
2023-03-28
1
180
首页
上一页
2
3
4
5
6
7
8
9
10
11
下一页
末页