guttttzhi
guttttzhi
全部文章
分类
Java专项(1)
题解(30)
归档
标签
去牛客网
登录
/
注册
guttttzhi的博客
全部文章
(共34篇)
题解 | #计算25岁以上和以下的用户数量#
CASE When的应用 select CASE when age < 25 or age is null then '25岁以下' when age >= 25 then '25岁及以上' end age_cut, count(*) number f...
Mysql
2022-05-24
0
210
题解 | #统计每个用户的平均刷题数#
统计每个用户的平均刷题数 count(distinct up.device_id) select university, difficult_level, count(qpd.question_id) / count(distinct up.device_id) avg_answer...
Mysql
2022-05-23
0
238
题解 | #统计每个学校各难度的用户平均刷题数#
统计每个学校各难度的用户平均刷题数 count(distinct up.device_id) select university,difficult_level,count(qpd.question_id)/count(distinct up.device_id) avg_answer_cnt ...
Mysql
2022-05-23
1
258
题解 | #统计每个学校的答过题的用户的平均答题数#
统计每个学校的答过题的用户的平均答题数 记录一下count(distinct up.device_id) select university,count(question_id) / count(distinct up.device_id) avg_answer_cnt from user_pr...
Mysql
2022-05-23
0
286
题解 | #连续子数组最大和#
连续子数组最大和 主要思路:dp数组的定义:dp【i】表示以第i位结尾的子数组的最大和。转态转移:如果dp[i-1]大于0,dp[i]=dp[i-1]+nums[i];如果小于等于0,dp[i]=sum[i]。初始化:dp【0】=nums[0] #include<bits/stdc++.h...
C++
2022-05-23
0
277
题解 | #二分查找-I#
二分查找 class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param nums int整型vector * @param target ...
C++
2022-05-23
0
230
题解 | #实现二叉树先序,中序和后序遍历#
二叉树的三种遍历(递归实现) /** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ class Solution { public: ...
C++
2022-05-23
0
316
题解 | #删除链表的节点#
删除链表中的节点 题目中的头节点真让人误导 /** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class S...
C++
2022-05-23
0
304
题解 | #合并两个排序的链表#
合并双链表 /* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/ class Solution { ...
C++
2022-05-23
0
302
题解 | #【模板】链表#
链表 #include<bits/stdc++.h> using namespace std; struct node { int val; node* next; }; typedef node* LinkList; int n, x, y; node* ad; s...
C++
2022-05-23
0
257
首页
上一页
1
2
3
4
下一页
末页