Tencent飞
Tencent飞
全部文章
题解
归档
标签
去牛客网
登录
/
注册
Tencent飞的博客
全部文章
/ 题解
(共40篇)
题解 | #连续子数组最大和#
#include <iostream> #include <algorithm> using namespace std; int main() { int n; cin >> n; int arr[n]; for (int i =...
C++
2022-04-26
0
351
题解 | #最小花费爬楼梯#
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader...
Java
2022-04-20
0
669
题解 | #打家劫舍(一)#
一、思路 动态规划: 确定属性:dp[i]dp[i]dp[i]表示从数组下标为000的房间开始到达数组下标为iii的房间此时所能获得的最多的偷窃金额。 确定边界条件: dp[0]=nums[0]dp[0] = nums[0]dp[0]=nums[0] 确定状态转移方程: dp[i]=max(dp[...
Java
2022-04-18
0
425
题解 | #判断链表中是否有环#
双指针fast和slow fast每次移动两步 slow每次移动一步 如果fast能走到null,说明没有环 如果slow能走到和fast相等,说明有环 /** * Definition for singly-linked list. * class ListNode { * in...
Java
2022-04-06
0
478
题解 | #月均完成试卷数不小于3的用户爱作答的类别#
select e2.tag , count(tag) as tag_cnt from exam_record e1 left join examination_info e2 using(exam_id) where e1.uid in (select e1.uid from ex...
Mysql
2022-03-15
0
402
题解 | #创建索引#
create index idx_duration on examination_info(duration); create unique index uniq_idx_exam_id on examination_info(exam_id); create fulltext index full...
Mysql
2022-03-14
0
277
题解 | #平均播放进度大于60%的视频类别#
select tag,concat(round(avg(case when TIMESTAMPDIFF(second, start_time, end_time)<=duration then TIMESTAMPDIFF(second, start_tim...
Mysql
2022-03-12
0
340
题解 | #各个视频的平均完播率#
SELECT a.video_id , round(sum(if(end_time - start_time >= duration, 1, 0))/count(start_time ),3) as avg_comp_play_rate FROM tb_user_video_log a LE...
Mysql
2022-03-12
0
362
题解 | #得分不小于平均分的最低分#
select min(e_r.score) as min_score_over_avg from exam_record e_r join examination_info e_i on e_r.exam_id = e_i.exam_id where e_i.tag = 'SQL' ...
Mysql
2022-03-12
0
374
题解 | #统计作答次数#
select COUNT(exam_id) as total_pv, count(submit_time) as complete_pv, # 先去重exam_id 并且分数 不为空 count(distinct exam_id and score is not...
Mysql
2022-03-12
0
324
首页
上一页
1
2
3
4
下一页
末页