wangdy level
获赞
13
粉丝
2
关注
0
看过 TA
6
华中科技大学
2020
Java
IP属地:未知
暂未填写个人简介
私信
关注
2019-09-04 11:30
已编辑
华中科技大学 Java
0 点赞 评论 收藏
分享
2019-08-15 23:39
已编辑
华中科技大学 Java
网易考拉本身员工都要裁不少,现在还在面试中的到时候怎么处理,感觉很有意思啊
只想进招行:放弃考拉吧,这时候进入就是等着被裁
投递阿里巴巴集团等公司10个岗位 >
0 点赞 评论 收藏
分享
2019-08-03 17:26
已编辑
华中科技大学 Java
第二题题目写的是按位与,文字中给的时OR |,说的又是与 测试用例等于白给,查询为YES的都是插入的原值 我按照按位与来搞的,最后还是10% 按位与: ``` public static boolean contain(Set<Integer> set, int target) { if (set.contains(target)) return true; Set<Integer> select = new HashSet<>(set); for (int i = 0; i < 32; i++) { //tar...
薛定谔彭于晏:ac #include <stdio.h> #include <unistd.h> #include <iostream> #include <vector> using namespace std; int main() { int q; cin >> q; vector<vector<int>> nums(30); while (q--) { int a, b; cin >> a >> b; if (a == 1) { for (int i = 25; i >= 0; i--) { if ((1 << i) & b) { nums[i].push_back(b); } } } else { bool flag = true; for (int i = 25; i >= 0; i--) { if (((1 << i) & b) == 0) { continue; } bool found = true; for (auto num: nums[i]) { if ((num | b) == b) { found = false; break; } } if (found) { flag = false; break; } } if (flag) { cout << "YES" << endl; } else { cout << "NO" << endl; } } } }
投递网易等公司10个岗位 >
0 点赞 评论 收藏
分享

创作者周榜

更多
关注他的用户也关注了:
牛客网
牛客企业服务