阿里笔试4.7

第一道 进制转换
4.79%

第二道 输出最大值
30%

第三道 下棋(没怎么仔细看题目)
0%


第一次做笔试给了阿里,看来自己还是太菜了。😭#阿里笔试##阿里巴巴##笔试题目#
全部评论
大佬轻喷
1 回复 分享
发布于 2022-04-08 17:06
#include<iostream> (5488)#include<set> using namespace std; set<int> s; const int N = 1e4+10; int main() {     int n ;     cin>>n;     while (n--) {         int c;         cin>>c;         if(s.find(c) == s.end()) {             s.insert(c);         }         else {             s.erase(c);             int x  = c<<1;             while(s.find(x) != s.end()){                 x<<1;             }             s.insert(x);                     }     }     cout<<*s.rbegin()<<endl;         } #include<iostream> (5488)#include<set> using namespace std; set<int> s; const int N = 1e4+10; int main() {     int n ;     cin>>n;     while (n--) {         int c;         cin>>c;         if(s.find(c) == s.end()) {             s.insert(c);         }         else {             s.erase(c);             int x  = c<<1;             while(s.find(x) != s.end()){                 x<<1;             }             s.insert(x);                     } 第二题你帮我看看这个可以吗     }     cout<<*s.rbegin()<<endl;         }
点赞 回复 分享
发布于 2022-04-10 01:14
我第一题也这个数,想不明白
点赞 回复 分享
发布于 2022-04-08 19:09

相关推荐

点赞 评论 收藏
分享
评论
2
2
分享

创作者周榜

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