科大讯飞2021.8.28.算法笔试试卷(三)

编程题:第一题

第三题
给定N位数 组成一个数的所有位置的数的和以及乘积是7的倍数
 输入

3
4
输出
2(表示两位数只有70 77 )
54(700,777,..)
 三道题都没完成,求前两道题完整题目
感觉第三道题简单,做了半个小时自动交卷了 但是没做出来

😢
有大佬做出来了可以交流下吗#科大讯飞笔试##科大讯飞##笔试题目#
全部评论
#include<iostream> #include<vector> #include<fstream> #include<string> #include<istream> #include<algorithm> #include<sstream> #include<map> //#include<bits/stdc++.h> using namespace std; int main(){         vector<int>v;         //int num;         int niuScore;         string ss;         string s1;         getline(cin,ss);         stringstream str;         str.str(ss);         while(str>>s1){             v.push_back(atoi(s1.c_str()));         }         cin>>niuScore;         sort(v.begin(),v.end());         map<int,string>map;
1 回复
分享
发布于 2021-08-29 10:03
第二道题我记得和LeetCode的游泳题目很像,用的dfs你可以看一看,https://leetcode-cn.com/problems/swim-in-rising-water/  我的三个题也没有做出来😂😂😂😂,第一个题有两个思路,https://www.nowcoder.com/discuss/723457?type=all&order=time&pos=&page=1&ncTraceId=&channel=-1&source_id=search_all_nctrack这里大佬提到了,你可以看看
1 回复
分享
发布于 2021-08-29 10:44
滴滴
校招火热招聘中
官网直投
我第一题通过了96%,第二题没看 第三题没做完开始题看错了直接白瞎20分钟。。。😭😭
1 回复
分享
发布于 2021-08-29 20:51
顶顶
点赞 回复
分享
发布于 2021-08-29 01:18
 for(int i=1;i<=5;i++){             map[i]="A+";         }         for(int i=6;i<=15;i++){             map[i]="A0";         }         for(int i=16;i<=30;i++){             map[i]="B+";         }         for(int i=31;i<=35;i++){             map[i]="B0";         }         for(int i=36;i<=45;i++){             map[i]="C+";         }         for(int i=46;i<=48;i++){             map[i]="C0";         }         for(int i=49;i<=50;i++){             map[i]="F";         }     int res;     for(int i=0;i<v.size();i++){ //cout<<niuScore<<" ";     if(v[i]==niuScore) {         res=i;         break;         };     }     string niuDgress=map[res+1];     cout<<niuDgress<<endl; system("pause");     return 0; }
点赞 回复
分享
发布于 2021-08-29 10:04
兄弟,你第二题有没有整个题目,有的话能否发我一下,我打算做一下😀
点赞 回复
分享
发布于 2021-08-29 10:45

相关推荐

1 21 评论
分享
牛客网
牛客企业服务