首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
华科平凡
亚马逊_AWS_GCR-TAM
华中科技大学
2018届
golang工程师
修福报群:742370985 (吹水交流)
关注
私信
加入黑名单
举报TA
TA的博客
首页
刷题
圈子
项目
笔记
基本资料
真题试卷
在线编程
心理测试
回答的问题(561)
母牛的故事
1
python解法 关键是找到递推公式a[n]=a[n-1]+a[n-3] import sys def cowCountAtSomeYear(n): arr=[1,2,3,4] while len(arr)<n: arr.append(arr[-1]+arr[...
发表于 2017-11-17 10:09:41
直方图
2
python solution: import sys from collections import Counter #从上到下输出直方图 def printHistogram(string): c = Counter(string) height = c.most_commo...
发表于 2017-11-17 09:37:13
考新郎
2
python solution import sys from math import factorial as f #求错位数的函数 def dislocationNumber(n): arr = [0, 1] while len(arr) < n: ar...
发表于 2017-11-17 09:21:02
砌墙
1
python 解法 思路:把数组里面所有小于平均数的元素,用平均数减去它,就是需要搬的次数,把这些结果加起来即可 核心代码只需要三行 while True: try: a, b = input(), list(map(int, input().split())) ...
发表于 2017-11-16 18:42:06
寄居蟹与海葵
1
python解法with注释 import sys def canFit(str1, str2): # 如果str2长度大于str1,返回false if len(str2) > len(str1): return False # 期望吻合的字符串,如str2=“Z...
发表于 2017-11-16 18:31:14
All-in-All
1
python solution 使用贪心算法。 import sys for i in sys.stdin.readlines(): str1, str2 = i.strip().split() for i in str1: if str2 and i == str...
发表于 2017-11-16 18:23:44
剪花布条
1
python solution: import sys for i in sys.stdin.readlines(): a,b=i.strip().split() print(a.count(b))
发表于 2017-11-16 18:17:23
换座位
1
python solution 使用deque来做。 from collections import deque import sys for i in sys.stdin.readlines(): string, num = i.strip().split() q = deque...
发表于 2017-11-16 18:07:47
英文金曲大赛
1
python solution import sys for i in sys.stdin.readlines(): arr = i.strip().split() scores = list(map(float, arr[:-1])) print(arr[-1], &qu...
发表于 2017-11-16 14:17:07
快到碗里来
1
python solution import sys for i in sys.stdin.readlines(): a,b=map(int,i.strip().split()) print("Yes" if a<2*b*3.14 else "No...
发表于 2017-11-16 12:08:24
首页
上一页
10
11
12
13
14
15
16
17
下一页
末页
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题