tommy_txj
tommy_txj
全部文章
分类
归档
标签
去牛客网
登录
/
注册
tommy_txj的博客
全部文章
(共25篇)
题解 | #两种做法与解析#
# # window出后一天的日期,之后if每行条件计数是否为日期差1 select visit_date, count(distinct id) as dau, sum(if(datediff(lead_date,visit_date)=1,1,0))/count(distinct b.id) a...
2023-11-09
0
235
题解 | #输出在5min内完成点击购买的用户ID#
select distinct a.user_id as uid from user_ad_click_time a join user_payment_time b using (user_id,trace_id) where adddate(click_time,interval 5 min...
2023-11-09
6
373
题解 | #验证刷题效果,输出题目真实通过率#
select user_id, count(distinct if(result_info=1,question_id,null))/count(distinct question_id) as question_pass_rate, sum(result_info)/ count(1) as p...
2023-11-08
3
322
题解 | #查询用户刷题日期和下一次刷题日期#
select user_id, date, lead(date,1,null) over(partition by user_id order by date) as nextdate from questions_pass_record; 当所求为窗口中某列的原值时,自然而然想到的是lead、l...
2023-11-08
0
273
题解 |
select cust_email from OrderItems join Orders using (order_num) join Customers using(cust_id) where prod_id='BR01' ; from t1 join t2 using (x) 优于 fr...
2023-11-03
0
190
题解 | #浙大不同难度题目的正确率#
select difficult_level, sum(if(result='right',1,0))/count(result) as correct_rate from user_profile as a, question_practice_detail as b, question_d...
2023-07-08
0
355
题解 | #统计复旦用户8月练题情况#
select a.device_id, '复旦大学' as university , count(question_id) as question_cnt, sum(yes) as right_question_cnt from (select device_id , question_id ...
2023-07-08
0
333
题解 | #矩阵乘法计算量估算#
# 这个题的核心思路为: # 我们从左到右去遍历一个带左右括号和字母的字符串,每当我们从左到右遇到一次右括号, # 注意,从左到右遇到的第一个右括号,一定是需要“开心消消乐”的最中间的一组,即开始消除的地方,非常巧妙 # 我们遇到第一个右括号,就消消乐掉上一个左括号和匹配的字母且此题中一定为(AB)...
2022-12-25
0
305
题解 | #数组分组#
# 这道题是比较折磨的对于递归不熟悉的本人来说 # 1,先将数组分成三个组,five为被5整除的数,three为被3整除的数,other为其他。 # (这里用if和elif就包含了逻辑顺序,即题中所说的先让5去挑,“被3整除的数中不包含5”) # 2,我们要做到事情很简单,即将other里的元素任意...
2022-12-21
0
336
题解 | #成绩排序#
while True: try: n = int(input()) # 知道了共n个字符 kind = int(input()) # 知道了0还是1 box = [input() for _ in range(n)] # 获取了各个名字成绩pa...
2022-12-20
0
206
首页
上一页
1
2
3
下一页
末页