FreeWheel 09.05 笔试情况统计

哪位老哥说一下思路啊~
#FreeWheel#
全部评论
第一题花了太多时间了,最后只会很笨的方法: drop table if exists t0; drop table if exists t1; drop table if exists t2; create table t0 as (select id from fw_advertiser where industry='Car&(14116)#39;); create table t1 as select fwa.name, count(fwc.duration) as total  from fw_creative as fwc join fw_advertiser as fwa on fwc.advertiser_id=fwa.id  where fwc.duration <= 20  group by fwa.id having fwa.id in (select * from t0); create table t2 as select fwa.name, count(*) as yes from fw_creative as fwc  join fw_advertiser as fwa on fwc.advertiser_id=fwa.id  group by fwa.id having fwa.id in (select id from fw_advertiser where industry='Car&(14116)#39;); select t1.name as advertiser_name, t2.yes / t1.total as percentage from t1 join t2 on t1.name = t2.name; 第二题就是层次遍历就行了。 第三题没时间看
1 回复 分享
发布于 2021-09-05 16:33
第二题层序遍历100% 通过了,计算每层的最小耗时
1 回复 分享
发布于 2021-09-05 16:34
第三题我用自定义排序加DP只过了四分之一,哪位老哥探讨下到底咋做...
1 回复 分享
发布于 2021-09-05 16:36
第三题我的想法是转换成图,当i可以排在j的前面的时候存在一条有向边<i, j>,然后选择一些节点开始深搜,最后找到一条最大的路径
1 回复 分享
发布于 2021-09-05 16:43
第三题一开始两层for循环只能33.33%,后来直接递归写了,过了60%
1 回复 分享
发布于 2021-09-05 18:17
第一题具体忘了,大概是 select fw_ad.name, round(sum(case when xxx<=20 1 else 0 end) / sum(1), 2) as result from fw_creative left join fw_ad on fw_creative.ad_id=fw_ad.id where fw_ad.industry="Car" group by fw_ad.name order by fw_ad.name 第二题层次遍历,但是不知道是数据有很多边界情况还是我写的代码不对,改了好多才ac 第三题没时间想了,随便写了点,过了13%……
1 回复 分享
发布于 2021-09-05 19:34
第二题难道我理解错题目了?只过了20% 大佬咋写的
点赞 回复 分享
发布于 2021-09-05 16:33
哎,sql不太熟,想了太久,后面第三题直接没写
点赞 回复 分享
发布于 2021-09-05 16:33
第三题和lc1691 堆叠长方体最大高度 有啥区别呀? dp只能过33%😭
点赞 回复 分享
发布于 2021-09-05 16:36
第三题感觉和偏序关系啥的有关,没做出来...
点赞 回复 分享
发布于 2021-09-05 16:39
如果是2坏了,只需要算1,2层的cost就行了,你们考虑了吗
点赞 回复 分享
发布于 2021-09-05 16:51
第一题sql没写,第二题层序遍历a了,第三题记忆化搜索a了
点赞 回复 分享
发布于 2021-09-05 16:58
平时这种hive sql/odps写的都要吐了,然后还是0%,搞不懂,我这么多年的sql都是错的?
点赞 回复 分享
发布于 2021-09-05 17:01
第三题感觉类似俄罗斯信封套娃,按照那个思路写就能过
点赞 回复 分享
发布于 2021-09-05 22:03
AC代码:https://www.nowcoder.com/discuss/732388?source_id=profile_create_nctrack&channel=-1
点赞 回复 分享
发布于 2021-09-05 22:53
这题都有什么corner case啊怎么就过不了呢
点赞 回复 分享
发布于 2021-09-05 23:13

相关推荐

评论
1
2
分享

创作者周榜

更多
牛客网
牛客企业服务