杨舜文
杨舜文
全部文章
分类
题解(113)
归档
标签
去牛客网
登录
/
注册
杨舜文的博客
全部文章
(共98篇)
题解 | #简单错误记录#
lines = [] ret = dict() while True: try: filename, lineno = input().split() except EOFError: break k = filename.split('\\'...
2021-08-21
1
259
题解 | #查找兄弟单词#
words = input().split() n = int(words.pop(0)) index = int(words.pop()) - 1 brother = words.pop() count = 0 ret = [] for word in words: if len(word...
2021-08-20
0
272
题解 | #判断两个IP是否属于同一子网#
def ip2int(ip): ret = 0 ip_li = ip.split('.') for i in range(0, 4): v = int(ip_li[i]) if not (0 <= v < 256): ...
2021-08-20
0
282
题解 | #密码截取#
def decoder(A): # write code here ret = 1 size = len(A) - 1 for i in range(1, size): cleft = i - 1 cright = i + 1 ...
2021-08-20
1
349
题解 | #字符串加解密#
def encoder(data): li = [] for i in data: if 'a' <= i < 'z': v = ord('A')-ord('a') + 1 elif 'A' <= i <...
2021-08-20
0
274
题解 | #整数与IP地址间的转换#
def ip2int(ip): i1,i2,i3,i4 = map(int, ip.split('.')) return i1 * pow(256, 3) + i2 * pow(256, 2) + i3 * 256 + i4 def int2ip(i): li = [] ...
2021-08-20
0
314
题解 | #合并表记录#
count = int(input()) ret = {} for _ in range(count): k, v = map(int, input().split()) if k in ret: ret[k] += v else: ret[...
2021-08-19
0
216
题解 | #质数因子#
num = int(input()) i = 2 li = [] while i<=num and num > 1: if num // i * i == num: num = num//i print(i,end=' ') con...
2021-08-19
0
225
题解 | #明明的随机数#
li = [] while True: case = set() try: i = int(input()) except EOFError: break for _ in range(i): case.add(int(...
2021-08-18
0
307
题解 | #表达式求值#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * 返回表达式的值 * @param s string字符串 待计算的表达式 * @return int整型 ...
2021-08-18
0
289
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页