网易雷火笔试题

第一题就是分析分析在分析,花了90分钟ac,第二题应该是后缀表达式求值问题,然而没有真正做过这个题,老师讲过,然并卵,第三题是大根堆和小根堆结合的一题ac,第四题应该是dfs加剪枝,剪枝不会思密达ac0.2,第五题完全不会#笔试题目##网易雷火#
全部评论
什么岗的,怎么跟我不一样
1 回复
分享
发布于 2019-04-08 00:41
#include<iostream> #include<vector> #include<stdlib.h> #include<math.h> using namespace std; int main() {     int x, y;     cin >> x >> y;     if (x < 0 || y < 0 || x > 1000000 || y > 1000000)     {         return (0);     }     if (x == y)     {         cout << x + 1 << endl;         return (0);     }     //if (x==1)     //{     //    cout << y + 1 << endl;     //    return (0);     //}     //if (y == 1)     //{     //    cout << y + 1 << endl;     //    return (0);     //}     if (x < y)     {         int temp = x;         x = y;         y = temp;     }     //fuction y=y0/x0*x     double a = y + 1;     double b = x + 1;     double coe = a / b;     int res = 0;     double flag1 = 0;     int flag = 0;     for (int i = 0; i <= x + 1; i++)     {         double temp1 = 0;         temp1 = coe*i;         int temp2 = (int)temp1;         if (fabs(temp1 - temp2) < 0.000001 || fabs(temp1 - temp2 - 1) < 0.000001)         {             flag = 1;             flag1 = temp1;             continue;         }         else         {             int temp3_top = int(temp1 + 1);             int temp3_bottom = int(temp1);             if (temp3_top > flag1 && temp3_top > temp1 )             {                 if (flag == 1)                 {                     flag1 = temp1;                     res += 2;                     flag = 0;                     continue;                 }                 else if (temp3_bottom > flag1 && temp1 > temp3_bottom)                 {                     flag1 = temp1;                     res += 2;                     flag = 0;                     continue;                 }                 else                 {                     res += 1;                     flag1 = temp1;                     continue;                 }             }             else             {                  flag1 = temp1;                 res += 2;                 continue;             }         }     }     cout << res << endl;     return (0); }
点赞 回复
分享
发布于 2019-04-07 17:33
小红书
校招火热招聘中
官网直投
中间数的问题,思路如下,创建大顶堆和小顶堆,1:将新元素加入大顶堆, 2:大顶堆的堆顶和小顶堆的堆顶逆序,交换; 3:如果大顶堆元素大于小顶堆元素+1,将大顶堆元素放进大顶堆中: 4:如果遇见print,若大顶堆元素等于小顶堆元素,输出小顶堆的堆顶元素; 5:如果遇见print,若大顶堆元素不等于小顶堆元素,输出大顶堆的堆顶元素;
点赞 回复
分享
发布于 2019-04-07 17:38
第四题其实有递推公式,动态规划做出来。
点赞 回复
分享
发布于 2019-04-07 17:54
第一题 自己试了大量测试用例能通过,提交通过率为0
点赞 回复
分享
发布于 2019-04-07 17:56
第四题,dp
点赞 回复
分享
发布于 2019-04-07 18:03
记错时间错过了肿么办
点赞 回复
分享
发布于 2019-04-07 19:47
大佬这笔试有选择题和简答题么
点赞 回复
分享
发布于 2019-08-03 18:37
强化学习岗位的 有人收到笔试通知吗
点赞 回复
分享
发布于 2019-08-03 21:45
啊哈,网易雷火你们考过了呀,今天考,四小时,紧张
点赞 回复
分享
发布于 2019-08-04 11:04

相关推荐

点赞 8 评论
分享
牛客网
牛客企业服务