7月31号华为试题:

第一题:

# test = "0.50000000000000"
# wantedPrice = float(test)import numpy as npn = 10000
wantedPrice = float(input())
maxTotal = int(np.ceil(wantedPrice)) * n
#向上取整M = int(wantedPrice) * 1
N = 1for total in range(maxTotal + 1):floorN = int(np.floor(total / wantedPrice))#向下取整if floorN != 0 and np.abs(total / floorN -wantedPrice) < np.abs(M / N - wantedPrice):M = totalN = floorNceilN = int(np.ceil(total / wantedPrice))if ceilN != 0 and np.abs(total / ceilN -wantedPrice) < np.abs(M / N - wantedPrice):M = totalN = ceilNprint(M, N)

第二题:

import java.util.Scanner;
public class huaweiStr {public static void main(String[] args){Scanner in = new Scanner(System.in);String out = "";int  num = 0;while(num!=3){String str = in.nextLine();String s = in.nextLine();if(str == null ||s == null)break;         String strnew = str+str;if(strnew.indexOf(s)!=-1)out = out+1;elseout = out+0;num++;}System.out.println(out);}
}

8月7号华为试题:

第二题:

from functools import reduceWORDS = []
LASTREPEAT = []def generateWords(leafPounds, nonLeafLabels, nonLeafPounds):if not nonLeafLabels:returnglobal WORDS, LASTREPEATparentsNum = leafPounds.count("1")repeat = []start = 0end = -1for i, ele in enumerate(leafPounds[1:]):if ele == "1":end = i + 1repeat.append(sum(LASTREPEAT[start:end]))start = endrepeat.append(sum(LASTREPEAT[start:]))characters = []for i in range(parentsNum):characters.extend([nonLeafLabels[i]] * repeat[i])for i in range(len(WORDS)):WORDS[i] += characters[i]LASTREPEAT = repeatgenerateWords(nonLeafPounds[:parentsNum], nonLeafLabels[parentsNum:],nonLeafPounds[parentsNum:])if __name__ == "__main__":M = int(input())labels = input().split(" ")hasChild = input().split(" ")pounds = input().split(" ")N = int(input())values = input().split(" ")P = int(input())key = input().split(" ")leafLabels = []leafPounds = []nonLeafLabels = []nonLeafPounds = []for i in range(M):if hasChild[i] == "0":leafLabels.append(labels[i])leafPounds.append(pounds[i])else:nonLeafLabels.append(labels[i])nonLeafPounds.append(pounds[i])WORDS = leafLabels.copy()LASTREPEAT = [1] * len(WORDS)generateWords(leafPounds, nonLeafLabels, nonLeafPounds)searchWord = reduce(lambda a, b: a + b, key[::-1])if searchWord in WORDS:print(values[WORDS.index(searchWord)])else:print(0)# 15
# 115 112 116 97 111 121 114 101 105 112 121 114 102 115 116
# 0 0 0 1 1 0 1 0 0 0 0 1 1 1 1
# 1 1 0 1 0 1 1 1 0 0 0 1 1 0 0
# 8
# 1 2 3 4 5 6 7 8
# 3
# 116 114 112# 15
# s p t a o y r e i p y r f s t
# 0 0 0 1 1 0 1 0 0 0 0 1 1 1 1
# 1 1 0 1 0 1 1 1 0 0 0 1 1 0 0
# 8
# 1 2 3 4 5 6 7 8
# 3
# t r p

8月15号360编程第一题:

N, M = list(map(int, input().split(" ")))
A = []
for i in range(N):line = list(map(int, input().split(" ")))A.append(line)result = 0
while True:area = [[0 for _ in range(M)] for _ in range(N)]for i in range(N):for j in range(M):if A[i][j] >= 1:area[i][j] = 6try:if A[i + 1][j] >= 1:area[i][j] -= 2except:passtry:if A[i][j + 1] >= 1:area[i][j] -= 2except:passtry:if A[i][j] >= 2:area[i][j] -= 2except:passallZero = Truefor i in range(N):for j in range(M):result += area[i][j]if A[i][j] >= 1:allZero = FalseA[i][j] -= 1if allZero:break
print(result)# 2 2
# 2 1
# 1 1

2020届华为和360优招技术岗软件笔试题相关推荐

  1. 电信面试计算机网络面试题,中国电信技术岗面笔试题库

    1.语音信号数字化过程中,采用的量化方法是非均匀量化. 2.PCM30/32路系统中,每个码的时间间隔是488ns . 3.PCM30/32路系统中,TS0用于传送帧同步信号,TS16用于传送话路信令 ...

  2. 2020届校招总结(秋招+春招)

    2020届校招总结(秋招+春招) 目录 个人情况 秋招 春招 总结 个人情况 末流211本科,通信工程专业,在实验室主要是做机器视觉和深度学习相关,实习在一家500强外企做数据挖掘,主要是在研究时序数 ...

  3. 如何看待2023年秋招技术岗哀鸿遍野?

    昨天在知乎上看到个提问"如何看待2023年秋招技术岗哀鸿遍野?". 最近有很多读者都找我咨询秋招问题,发现同学们的秋招之路都不是很顺,不是个人的问题,而是大环境的问题,今年秋招形势 ...

  4. 2023年秋招技术岗---哀鸿遍野!

    昨天在知乎上看到个提问"如何看待2023年秋招技术岗哀鸿遍野?". 最近有很多读者都找我咨询秋招问题,发现同学们的秋招之路都不是很顺,不是个人的问题,而是大环境的问题,今年秋招形势 ...

  5. 【求职】小米 2018 秋招测试开发工程师笔试题

    小米 2018 秋招测试开发工程师笔试题 一.单选题 1.静态变量static 在不同的实例中地址是否一样?他们储存在什么区域?( ) A. 地址一样,在堆栈区. B. 地址不一样,在堆栈区. C. ...

  6. 京东2019春招Java开发类笔试题

    京东2019春招Java开发类笔试题 1. (单选题) 在对问题的解空间树进行搜索的方法中,一个结点有多次机会成为活结点的是 ( B ) A. 动态规划 B. 回溯法 C. 分支限界法 D. 回溯法和 ...

  7. 【求职】京东 2018 秋招测试开发工程师笔试题

    京东 2018 秋招测试开发工程师笔试题 一.单选题 1.若度为m 的哈夫曼树中,其叶结点个数为 n,则非叶结点的个数为( ) A. n-1 B. n/m-1 C. (n-1)/(m-1) D. n/ ...

  8. 最新华为网络工程师优招面试经历

    华为网络工程师面试主要分为群面-业务面试-综合面试-英语测试 群面 一般两组每组6-8人不等,现在群面华为较之前的群面有所改变!!先进去面试官介绍面试的流程,然后按座位(座位是随机安排的,不是自己想和 ...

  9. 2020届华为勇敢星实习面试经验贴-------硬件类逻辑岗位

    本次2020届西北地区华为勇敢星始于2019.03.06,结束于2019.03.23,整个过程持续17天,可以说华为的办事效率还是很高的,不像某些公司,投了简历之后一直吊着你,简历一直处于初筛阶段,根 ...

最新文章

  1. 基于SSM+Layui+Bootstrap实现学校教师技能大赛评分系统
  2. django 限制匿名用户访问以及重定向
  3. Selenium之Android使用学习
  4. leetcode 279. 完全平方数 bfs广度优先解法 图解 动态规划解法 c代码
  5. 【生活】 戴尔XPS 插上耳机之后,说话没声音,麦克风失效 window10 系统
  6. 软件设计之UML—UML中的六大关系
  7. SAP Spartacus lock focus Directive的工作原理示意图
  8. WordPress 三个必须的安全措施
  9. 自动驾驶——多传感器融合的学习笔记
  10. 航空信息指挥调度系统_应急指挥中心指挥调度系统解决方案(一)
  11. centos 7 install VirtualBox
  12. java图片压缩工具
  13. 免费HTML5期末大作业:我的家乡网站设计——可根据百度百科--曹县
  14. 计算机制图视频教程,机械制图视频教程
  15. 计算机网络第七版谢希仁习题,计算机网络 释疑与习题解答 谢希仁 第7七版 计算机网络(第7版)谢...
  16. Ubuntu20.04开启wifi热点
  17. 从数据库导出数据到EXCEL换行的问题解决方法
  18. oracle 列转行
  19. Oracle存储过程基本语法 存储过程
  20. 解决pytest运行时报错ModuleNotFoundError

热门文章

  1. matebookxpro上鸿蒙系统,笔记本只能选苹果?华为MateBookXPro超过性价比,让果粉秒变花粉...
  2. laravel mysql 分表_laravel分库分表
  3. python爬取加密qq空间_使用python+selenium爬取qq空间好友动态
  4. 【Fiddler】iOS机抓取https数据时,失败,全部显示“Tunnel to......443”和手机代理后无法上网的现象
  5. 从零到壹构建基于 Fabric-SDK-Go 的Web应用之三:完成Web应用
  6. sidecar异构调用php,sidecar异构微服务
  7. 老师教了我们二年的PS 全部在这里
  8. 果粉看了别哭!回顾iPhone历代问题门,最后一个亮了
  9. 总结的关于英语中的外来词
  10. 基本数据类和引用数据类型