VIPKID笔试 大数据开发工程师方向 编程题

VIPKID 2020校招 大数据开发工程师在线考试
编程题 | 20.0分1/2
取最优秀的学员
时间限制:C/C++语言 1000MS;其他语言 3000MS
内存限制:C/C++语言 65536KB;其他语言 589824KB
题目描述:
根据不同的数据集判断出最优秀的学生,

PS:题目难易度(简单p1->p5难)

输入
表S,表结构:

st_id bigint comment "学生id"

,st_name varchar(30) comment "学生姓名"

,score int comment "分数"

,pro_type varchar(20) comment "题目类型p1~p5"

,start_time datetime comment "答题开始时间"

输出
最终只输出一条数据,最优秀的学生的学生id和姓名


样例输入
create table S(st_id bigint, st_name varchar(30),score int,pro_type varchar(20),start_time datetime);
insert into S(st_id,st_name,score,pro_type,start_time) values(1,'T',10,'p1','2019-08-22 10:09:13');
insert into S(st_id,st_name,score,pro_type,start_time) values(1,'T',8,'p2','2019-08-22 10:09:17');
insert into S(st_id,st_name,score,pro_type,start_time) values(1,'T',9,'p3','2019-08-22 10:09:37');
insert into S(st_id,st_name,score,pro_type,start_time) values(1,'T',5,'p4','2019-08-22 10:10:25');
insert into S(st_id,st_name,score,pro_type,start_time) values(1,'T',2,'p5','2019-08-22 10:12:30');
insert into S(st_id,st_name,score,pro_type,start_time) values(2,'L',9,'p1','2019-08-22 11:29:22');
insert into S(st_id,st_name,score,pro_type,start_time) values(2,'L',9,'p2','2019-08-22 11:29:30');
insert into S(st_id,st_name,score,pro_type,start_time) values(2,'L',7,'p3','2019-08-22 11:29:53');
insert into S(st_id,st_name,score,pro_type,start_time) values(2,'L',3,'p4','2019-08-22 11:32:20');
insert into S(st_id,st_name,score,pro_type,start_time) values(2,'L',0,'p5','2019-08-22 11:34:07');
insert into S(st_id,st_name,score,pro_type,start_time) values(3,'W',10,'p1','2019-08-22 11:34:03');
insert into S(st_id,st_name,score,pro_type,start_time) values(3,'W',9,'p2','2019-08-22 11:34:08');
insert into S(st_id,st_name,score,pro_type,start_time) values(3,'W',9,'p3','2019-08-22 11:34:26');
insert into S(st_id,st_name,score,pro_type,start_time) values(3,'W',4,'p4','2019-08-22 11:35:01');
insert into S(st_id,st_name,score,pro_type,start_time) values(3,'W',2,'p5','2019-08-22 11:36:12');
insert into S(st_id,st_name,score,pro_type,start_time) values(4,'X',10,'p1','2019-08-22 11:39:10');
insert into S(st_id,st_name,score,pro_type,start_time) values(4,'X',8,'p2','2019-08-22 11:39:17');
insert into S(st_id,st_name,score,pro_type,start_time) values(4,'X',8,'p3','2019-08-22 11:39:41');
insert into S(st_id,st_name,score,pro_type,start_time) values(4,'X',5,'p4','2019-08-22 11:41:15');
insert into S(st_id,st_name,score,pro_type,start_time) values(4,'X',3,'p5','2019-08-22 11:43:59');
样例输出
st_id   st_name
3        W

寻找zero 组数
时间限制:C/C++语言 1000MS;其他语言 3000MS
内存限制:C/C++语言 65536KB;其他语言 589824KB
题目描述:
给定一个整数的数组,找出其中的pair(a,  b),使得a+b=0,并返回这样的pair数目。(a,  b)和(b,  a)是同一组。

输入
 整数数组

输出
找到的pair数目


样例输入
-1,  2,   4,  5,  -2
样例输出
1
暂时只有题目 结束给 代码 两题AC

#VIPKID##笔试题目##大数据开发工程师#
全部评论
坐等
点赞 回复
分享
发布于 2019-09-03 17:28
寻找0数组,一直33,醉了
点赞 回复
分享
发布于 2019-09-03 17:30
淘天集团
校招火热招聘中
官网直投
同33,不知道是输入输出有问题还是逻辑。
点赞 回复
分享
发布于 2019-09-03 17:32
sql 那题一直50%,求解答
点赞 回复
分享
发布于 2019-09-03 17:33
一直33% 
点赞 回复
分享
发布于 2019-09-03 17:40
什么叫优秀的学生啊
点赞 回复
分享
发布于 2019-09-03 17:49
第一题我的答案: SELECT temp.st_id AS st_id, temp.st_name AS st_name  FROM ( SELECT st_name, st_id, sum( score ) AS sumSorce, strftime ( '%s', max( start_time ) ) - strftime ( '%s', min( start_time ) ) AS user_time  FROM S  GROUP BY st_name, st_id  ) temp  ORDER BY sumSorce DESC, user_time  LIMIT 1 第二题答案: public class Main {     public static void main(String[] args) {         Scanner scan=new Scanner(System.in);         String lines=scan.nextLine();         String[] arr=lines.split(",");         for(int i=0;i<arr.length;i++){             arr[i]=arr[i].trim();         }         long result=0;         StringBuffer sb=new StringBuffer();         for(int i=0;i<arr.length;i++){             for(int j=0;j<arr.length;j++){                 if(Long.parseLong(arr[i])+Long.parseLong(arr[j])==0 && sb.indexOf(j+"")==-1 && sb.indexOf(i+"")==-1){                     sb.append(i+"&"+j);                     result++;                 }             }         }         System.out.println(result); /*        for(String str:arr){             System.out.println(str);         }*/     } }
点赞 回复
分享
发布于 2019-09-03 18:08

相关推荐

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