当前位置:网站首页>找的笔试题的复盘(一)
找的笔试题的复盘(一)
2022-08-10 20:40:00 【最 上 川】
百度2020校招Java研发工程师笔试卷(第三批)
| 2、当请求过多,超出线程池负荷的时候,会触发拒绝策略。下列选项中,对于拒绝策略的描述错误的是( ): |
|---|
| A.CallerRunsPolicy,线程调用运行该任务的 execute 本身,此策略提供简单的反馈控制机制,能够减缓新任务的提交速度 |
| B.AbortPolicy,处理程序遭到拒绝将直接抛出异常,丢弃任务。 |
| C.DiscardPolicy,不能执行的任务将被删除。这种策略将丢弃任务,同时也会抛出异常。 |
| D.DiscardOldestPolicy,如果执行程序尚未关闭,则位于工作队列头部的任务将被删除,然后重试执行程序。 |
| 解析:看到A的后半段没见过就选了,但想一想就是这样的,这个线程用来执行任务,就 |
| 5、下面几项关于Java程序初始化的几个原则:①静态对象(变量)优先于非静态对象(变量)初始化;②父类优先于子类进行初始化;③按照成员变量的定义顺序进行初始化;其中正确的有:() |
|---|
| 复盘:第三个总觉得怪怪的就没选,他没有“静态或非静态成员变量”这个前提,就与①冲突了 |
| 8、现有一字符串"hello world",使用哈夫曼编码最少使用多少bit内存:() |
|---|
| 解析:好久没做过这种题都忘了,编码是编程01码 |
![]() |
| 10 一个sql题,错在LIKE那里了 |
|---|
| 解析:%州是以’州’为结尾 |
| 11 假设有必修课成绩表course,每位学生的期末考试成绩以及补考成绩都录入到course表中,学号为20190001的同学想查询一下自己未通过的课程的课程编号与课程名称,那么下面正确的sql语句是
create table course(id int(11) not null auto_increment,sid int(11) not null comment ‘学号’,cid int(11) not null comment ‘课程编号’,cname char(50) not null comment ‘课程名称’,score int(11) not null comment ‘分数’,
primary key(id)
| )engine = innodb; |
|---|
| select distinct cid,cname from course where cid not in (select cid from course where score > 60) and sid=20190001 |
| select distinct cid,cname from course where cid in (select cid from course where score < 60 and sid=20190001) |
| 解析:注意题意,录入了期末考成绩和补考成绩,所以实际上未通过的是指两门都没过的,这里我们应该直接取not in |
| 12 序列{20, 23, 28, 41, 61, 31, 71, 76, 15, 30}构造为完全二叉树,完全二叉树再变为最小堆后,堆所对应的的中序遍历序列可能为() |
|---|
| 所以其实他给的完全二叉树的序列,就是一个层序遍历的序列,然后就是拿着每个父节点不断下沉、交换的过程了 |
![]() |
|
![]() |
|---|
| emm,我现在只能有个感觉,就是他return里的两个调用,其实类似于二叉树遍历的左右子树遍历,所以近似于2^N次方吧 |
![]() |
|---|
| 解析:我还以为是啥数学题,其实就是把多次减法用一次除法和取模解决了 |
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
int main(){
int N;
cin>>N;
ll a[N];
for(int i=0;i<N;i++){
cin>>a[i];
}
ll res=0;
while(true){
sort(a,a+N);
if(a[N-1]<N){
break;}
ll div = a[N-1]/N;
a[N-1]=a[N-1]-N*div;
for(int i=0;i<N-1;i++){
a[i]+=div;}
res+=div;
}
cout<<res<<endl;
return 0;
}
边栏推荐
- npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
- Common functions of Auto.js to find pictures and colors
- Before implementing MES management system, these three questions to consider
- ACM MM 2022 统一归一化:加速Transformer工业部署的归一化方法
- 知识图谱Knowledge Graph
- "POJ 3666" Making the Grade problem solution (two methods)
- Rider调试ASP.NET Core时报thread not gc-safe的解决方法
- cordova installation error Command failed: powershell solution
- Apple Font Lookup
- Are you hungry - Institution tree radio
猜你喜欢

【golang map】 深入了解map内部存储协议

XML小讲

mysql----group by、where以及聚合函数需要注意事项

【nvm】【node多版本管理工具】使用说明和踩坑(exit status 1)

YOLOv3 SPP source analysis

面向未来的 IT 基础设施管理架构——融合云(Unified IaaS)

Date picker component (restrict year to set only displayed months)

Are you hungry - Institution tree radio

Transferrin-modified vincristine-tetrandrine liposomes | transferrin-modified co-loaded paclitaxel and genistein liposomes (reagents)

《分布式微服务电商》专题(一)-项目简介
随机推荐
机器学习笔记:t-SNE
Web3中值得关注的基础设施
知识图谱Knowledge Graph
leetcode 84.柱状图中最大的矩形 单调栈应用
A fullGC problem troubleshooting caused by groovy
TortoiseSVN小乌龟的使用
论配置化系统的配置
ES6中的for...in/of的使用
C 语言 时间函数使用技巧(汇总)
组合导航精度分析
The servlet mapping path matching resolution
The evolution history of Go programmers
Redis命令手册
Kyligence 通过 SOC 2 Type II 审计,以可信赖的企业级产品服务全球客户
2021年中国工业互联网安全大赛(福建省选拔赛) 暨首届福建省工业互联网创新大赛
(10) Sequence and deserialization of image data
Public Key Retrieval is not allowed(不允许公钥检索)【解决办法】
mysql----group by、where以及聚合函数需要注意事项
kuberentes Auditing 入门
如何提高代码的可读性 学习笔记



