滴滴9.4笔试


#笔试##滴滴##滴滴23秋招笔试有点儿难啊#
全部评论
hi~同学,秋招遇“寒气”,牛客送温暖啦!23届秋招笔面经有奖征集中,参与就得牛客会员7天免费体验,最高赢300元京东卡!戳我去看>>>https://www.nowcoder.com/link/zhengjipinglun
点赞 回复 分享
发布于 2022-09-05 13:46 北京
有没有一种可能,数据是错的
点赞 回复 分享
发布于 2022-09-04 21:32 广西
球球大佬 看看为啥答案错误 public class Main {     static long[] nums;     static long res = 0;     public static void main(String[] args) {         Scanner scanner = new Scanner(System.in);         long n = scanner.nextLong();         long k = scanner.nextLong();         nums = new long[(int) n];         for (int i = 0; i < n; i++) {             nums[i] = scanner.nextLong();         }         Arrays.sort(nums);         backtrack(nums.length, 0, 0, 0, 0, k);         System.out.println(res);     }     private static void backtrack(long n, int cur, long sum, long total, long maxWeight, long k) {         if (total != 0) {             if (maxWeight * total<= sum  * k) {                 res = Math.max(res, total);             } else {                 return;             }         }         if (cur == n) {             return;         }         backtrack(n, cur + 1, sum + nums[cur], total + 1, Math.max(maxWeight, nums[cur]), k);         backtrack(n, cur + 1, sum, total, maxWeight, k);     } }
点赞 回复 分享
发布于 2022-09-04 21:07 四川
求第一题ac代码
点赞 回复 分享
发布于 2022-09-04 20:51 四川
1.73 第二题打表 第一题头尾分别遍历0.73 用滑动窗口0.63 不知道是不是用long乘判断大小越界了 没用double
点赞 回复 分享
发布于 2022-09-04 20:43 广东
第一题一直卡55,求大佬解答,贴个代码。
点赞 回复 分享
发布于 2022-09-04 20:41 四川

相关推荐

活泼的代码渣渣在泡池...:哈哈哈挺好的,我也上岸美团了,不说了,我又接了一单
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务