杨舜文
杨舜文
全部文章
分类
题解(113)
归档
标签
去牛客网
登录
/
注册
杨舜文的博客
全部文章
(共98篇)
题解 | #求最大连续bit数#
import sys for line in sys.stdin.readlines(): n = int(line) ret = count = 0 while (n): count = count + 1 if (n % 2) else 0 ...
2021-08-26
1
352
题解 | #统计大写字母个数#
import sys for line in sys.stdin.readlines(): count = 0 for c in line: if 'A' <= c <= 'Z': count += 1 print(coun...
2021-08-26
0
280
题解 | #简单密码#
import sys pairs = ( (2, '2'), (5, '3'), (8, '4'), (11, '5'), (14, '6'), (18, '7'), (21, '8'), (25, '9') ) for line ...
2021-08-26
1
360
题解 | #等差数列#
import sys a1 = 2 for line in sys.stdin.readlines(): n = int(line) an = 3 * n - 1 print(int((3 * n * n + n) / 2))
2021-08-26
0
238
题解 | #等差数列#
import sys for line in sys.stdin.readlines(): n = int(line) total = 0 for i in range(1, n+1): total += 3 * i - 1 print(total)
2021-08-26
0
225
题解 | #最长回文子串#
import sys for line in sys.stdin.readlines(): line = line.strip() length = len(line) ret = 1 for i in range(1, length - 1): le...
2021-08-26
0
244
题解 | #字符串加密#
letters = tuple(chr(ord('A') + i) for i in range(26)) def get_key(line1): li = [] for i in range(len(line1)): if line1.count(line1[i]...
2021-08-26
0
280
题解 | #表达式求值#
import sys def compute(expr): sign = "+" ret = [0] num = 0 size = expr.__len__() i = 0 while (i < size): ...
2021-08-25
2
460
题解 | #称砝码#
while True: try: input() m_li = [int(x) for x in input().split()] x_li = [int(x) for x in input().split()] except EOFE...
2021-08-25
1
344
题解 | #参数解析#
args = input().split() ret = [] word = "" for argv in args: if argv[0] == "\"": if argv[-1] == "\""...
2021-08-24
0
271
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页