XiaoBY
XiaoBY
全部文章
分类
归档
标签
去牛客网
登录
/
注册
XiaoBY的博客
全部文章
(共48篇)
题解 | 获取指定客户每月的消费额
select SUBSTRING(t_time, 1, 7) as time, sum(t_amount) as total from trade join customer on trade.t_cus = customer.c_id where c_nam...
2025-09-24
0
55
题解 | 广告点击的高峰期
select hour(click_time) as click_hour, count(hour(click_time)) as click_cnt from user_ad_click_time group by click_hour order by c...
2025-09-22
0
42
题解 | DNA序列
import sys # 读取输入的DNA字符串和目标子串长度 string = input() # 输入的DNA序列字符串 length = int(input()) # 需要寻找的子串长度 # 初始化存储所有可能子串和对应GC含量的列表 A_string = [] # 存储所有长度为l...
2025-07-04
0
58
题解 | MP3光标位置
import sys # 读取输入:歌曲总数和操作序列 songs_num = int(input()) # 歌曲总数 orders = input() # 操作序列(U:上移,D:下移) # 初始化当前选中歌曲和相对位置 orgin_song = 1 ...
2025-07-03
0
71
题解 | 查找两个字符串a,b中的最长公共子串
import sys # 读取两个输入字符串 s = input() # 第一个字符串 t = input() # 第二个字符串 # 初始化存储公共子串长度和内容的列表 string_len_list = [] # 存储所有公共子串的长度 string_list = [] # 存...
2025-07-03
0
65
题解 | 找出字符串中第一个只出现一次的字符
import sys # 读取输入的字符串 s = input() # 初始化标志位,用于标记是否找到第一个不重复字符 flag = 0 # 遍历字符串中的每个字符 for i in range(len(s)): # 统计当前字符在字符串中出现的次数 temp = s.coun...
2025-07-02
0
67
题解 | 挑7
import sys # 读取输入的整数n,表示要检查的数字范围上限 n = int(input()) # 初始化计数器,用于统计满足条件的数字个数 count_7 = 0 # 遍历从1到n的所有数字 for i in range(1, n+1): # 设置标志位,初始为1(表示尚未找...
2025-07-02
0
56
题解 | 查找兄弟单词
import sys # 读取输入字符串并按空格分割成列表 # 示例输入: "3 abc cba bac xyz 2" → ['3', 'abc', 'cba', 'bac', 'xyz', '2'] question_list = list(map(str, input()....
2025-06-30
0
58
题解 | 字符串加密
import sys # 输入字符串s和t s = input() t = input() # 参考字符串,便于后续字符串t的比较 cankao_string = "abcdefghijklmnopqrstuvwxyz" # 保留字符串s第一次出现的字母,其余的字母都去掉 ...
2025-06-24
0
89
题解 | 字符串加解密
import sys s = list(map(str, input())) t = list(map(str, input())) # 字符串s的加密 s_encode = '' for i in range(len(s)): if 'a' <= s[i] <= 'y': ...
2025-06-23
0
75
首页
上一页
1
2
3
4
5
下一页
末页