柚茶_Rola
柚茶_Rola
全部文章
分类
归档
标签
去牛客网
登录
/
注册
柚茶_Rola的博客
全部文章
(共451篇)
题解 | #将真分数分解为埃及分数#
a,b = list(map(int,input().split('/'))) a = a*10 #分子 b = b*10 #分母 res = [] # 分解a while a : for i in range(a,0,-1): if b%i ==...
2024-02-01
0
151
题解 | #火车进站#
# wait:等待进站 #stack:进站列表 #out:出站列表 def f(wait,stack,out): if not wait and not stack: # 所有的车都出站了,即wait和stack均为空,空本身就是false,not空=true r...
2024-02-01
0
151
题解 | #参数解析#
s = input() # 输入的字符串 res = [] #用来存储分割后的字符串 def f(x): # 按照空格分,返回列表 ls = x.split() return ls #分两种情况: #1 字符串中不含引号,直接按照空格分 if '"' no...
2024-02-01
0
135
题解 | #字符串通配符#
while True: try: # 在 Python 中,使用 re 模块来处理正则表达式。 # re 模块提供了一组函数,允许你在字符串中进行模式匹配、搜索和替换操作。 #re 模块使 Python 语言拥有完整的正则表达式功能。 ...
2024-01-31
0
195
题解 | #矩阵乘法计算量估算#
n = int(input()) # 矩阵的个数 arr = [] # 存储矩阵 order = [] # 存储计算法则 res = 0 #输入矩阵的行列信息 for i in range(n): arr.append(list(map(int,input().split(...
2024-01-31
0
157
题解 | #矩阵乘法#
from re import A x = int(input())# 第一个列表的行 y = int(input()) # 第一个列表的列和第二个列表的行 z = int(input()) # 第二个列表的列 m1 = [] # 列表1 m2 = [] # 列表2 m3...
2024-01-31
0
159
题解 | #24点游戏算法#
def f(nums,target): if (len(nums) == 1): return nums[0] == target for i in range(len(nums)): c = nums[i] # 当前数字 tmp = ...
2024-01-31
0
181
题解 | #查找两个字符串a,b中的最长公共子串#
strA = input() strB = input() res = '' # 需要保证strA里面存的是较短的那串,如果不是的话,需要交换一下 if len(strA) > len(strB): strA,strB = strB,strA # 遍历strA for i in r...
2024-01-30
0
141
题解 | #DNA序列#
DNA = input() # 输入DNA序列 N = int(input()) # 输入子串的长度 str = [] # 存储切片后的子串 GC_Ratio = [] # 存储GC的占比,即GC-Ratio #遍历位置 for i i...
2024-01-29
0
121
题解 | #找出字符串中第一个只出现一次的字符#
str = input() lcount = -1 # 如果不存在,输出-1 # 遍历位置 for i in range(len(str)): if str.count(str[i]) == 1: lcount = str[i] break print(...
2024-01-29
0
180
首页
上一页
34
35
36
37
38
39
40
41
42
43
下一页
末页