杨舜文
杨舜文
全部文章
分类
题解(113)
归档
标签
去牛客网
登录
/
注册
杨舜文的博客
全部文章
(共98篇)
题解 | #高精度整数加法#
while True: try: n1 = int(input()) n2 = int(input()) except EOFError: break print(str(n1+n2))
2021-08-24
0
244
题解 | #自守数#
import sys for line in sys.stdin.readlines(): n = int(line) + 1 ret = 0 for i in range(0, n): if str(i * i).endswith(str(i)): ...
2021-08-24
0
264
题解 | #求最小公倍数#
import sys for line in sys.stdin.readlines(): a, b = (int(x) for x in line.strip().split()) ret = 1 for i in range(2, min(a,b) + 1): ...
2021-08-24
0
199
题解 | #合法IP#
import sys def IsValidIp(ip): if len(ip) != 4: return False for i in ip: if not (0 <= i <= 255): return Fal...
2021-08-24
0
265
题解 | #24点游戏算法#
import sys signs = ['+', '-', '*', '/'] precision = 0.00001 min24 = 24 - precision max24 = 24 + precision def compute24(n1, n2, n3, n4): for s1 ...
2021-08-23
2
407
题解 | #求小球落地5次后所经历的路程和第5次反弹的高度#
height = float(input()) total = 0.0 for _ in range(5): total += height height = height / 2 total += height print(total - height) print(hei...
2021-08-23
0
243
题解 | #从单向链表中删除指定值的节点#
line = input().split() li = [line[1]] opts = line[2:-1] for i in range(0, len(opts), 2): try: pos = li.index(opts[i]) li.insert(po...
2021-08-23
0
233
题解 | #查找两个字符串a,b中的最长公共子串#
while True: try: s1 = input().strip() s2 = input().strip() except EOFError: break if len(s1) > len(s2): ...
2021-08-22
0
299
题解 | #名字的漂亮度#
import sys for line in sys.stdin.readlines()[1:]: li = list(line.strip()) ret = [] for c in li: if c not in map(lambda x:x[0], re...
2021-08-22
0
244
题解 | #字符串排序#
import sys for line in sys.stdin.readlines(): letters = {} for i in range(26): letters[chr(ord('a')+i)] = [] others = [] li =...
2021-08-22
0
309
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页