首页
题库
公司真题
专项练习
面试题库
在线编程
面试
面试经验
AI 模拟面试
简历
求职
学习
基础学习课
实战项目课
求职辅导课
专栏&文章
竞赛
我要招人
发布职位
发布职位、邀约牛人
更多企业解决方案
AI面试、笔试、校招、雇品
HR免费试用AI面试
最新面试提效必备
登录
/
注册
日不落拓海海
获赞
308
粉丝
41
关注
6
看过 TA
404
女
Technische Universität Darmstadt
2021
人工智能
IP属地:香港
暂未填写个人简介
私信
关注
拉黑
举报
举报
确定要拉黑日不落拓海海吗?
发布(69)
评论
刷题
收藏
日不落拓海海
关注TA,不错过内容更新
关注
2022-02-15 20:32
已编辑
Technische Universität Darmstadt 人工智能
题解 | 动态规划python3#购物单#
这一题真的花了我好长时间!!!这一题是01背包问题的衍生,但是多了一个附件的判断,导致这道题很琐碎要考虑很多细节。(感觉要是机考考这道题我完全做不完了) 前提知识背景:01背包问题 (不知道这道题怎么做的可以先把01背包问题看懂https://zhuanlan.zhihu.com/p/104738622) 本题: 重点是如何处理附件问题。我们可以先把自己所得的数据进行分类(分为两个表格): 所得数据(举例): 50 5 20 3 5 20 3 5 10 3 0 10 2 0 10 1 0 单价价格表(相当于背包问题的重量,限制我们总金额)W[i]=v (注意:该编号为主件编号,不一定从1 ...
漫不经心随遇而安:
好厉害,思路很清晰,看下来好像很简单,但是让我写我又写不出来
0
点赞
评论
收藏
分享
2022-02-15 14:12
Technische Universität Darmstadt 人工智能
题解 | 中心拓展法#最长回文子串#
与密码截取这道题一模一样 def spread(left, right): ans=0 while left>=0 and right<= n-1 and s[left]==s[right]: ans =right - left +1 left-=1 right+=1 return ans while True: try: s = input() n = len(s) max_ans = 0 for i in range(n): ...
0
点赞
评论
收藏
分享
2022-02-13 23:18
Technische Universität Darmstadt 人工智能
2022-02-13
在牛客打卡6天,今天学习:刷题 6 道/代码提交 23 次
每日监督打卡
0
点赞
评论
收藏
分享
2022-02-13 23:15
Technische Universität Darmstadt 人工智能
题解 | 穷举#24点运算#
import itertools def change_str(str_cal): str_cal = str_cal.replace('11','J').replace('12','Q').replace('13','K').replace('1','A') return str_cal def check_str(): num =[] cal = ['+','-','*','/'] for t in s: if t == 'JOKER' or t == 'joker': return "ERROR" ...
0
点赞
评论
收藏
分享
2022-02-13 21:47
Technische Universität Darmstadt 人工智能
题解 | #记票统计#
字典法求解。字典的遍历: for key,values in dic.items() while True: try: n = int(input()) s = input().split(" ") candidate={} for i in s: candidate[i] = 0 candidate['Invalid']=0 m = int(input()) votes = input().split(" ") for v in ...
0
点赞
评论
收藏
分享
2022-02-13 21:29
已编辑
Technische Universität Darmstadt 人工智能
题解 | #字符串加解密#
直接判断求解 while True: try: s1=input() s2=input() s1_new = '' s2_new = '' for i in s1: if i.isupper(): if i == 'Z': s1_new+='a' else: s1_new += chr(ord(i)+1).lower() ...
0
点赞
评论
收藏
分享
2022-02-13 20:34
Technische Universität Darmstadt 人工智能
题解 | 中心扩展法#密码截取#
def spread(left,right): ans = 0 global n global s while left >=0 and right<= n-1 and s[left]==s[right]: ans = right-left+1 left -=1 right +=1 return ans while True: try: s = input() max_ans = 0 n = len(s) for i in...
0
点赞
评论
收藏
分享
2022-02-13 19:35
Technische Universität Darmstadt 人工智能
题解 | #密码验证合格程序#
def checkifTrue(s): if len(s) <=8: return False big_alpha = 0 small_alpha = 0 number = 0 others = 0 for i in s: if i.isdigit(): number = 1 elif i.isupper(): big_alpha = 1 elif i.islower(): small...
0
点赞
评论
收藏
分享
2022-02-13 14:37
Technische Universität Darmstadt 人工智能
题解 | #数字颠倒#
while True: try: print(input()[::-1]) except: break [::-1]来表示倒叙
0
点赞
评论
收藏
分享
2022-02-11 22:47
Technische Universität Darmstadt 人工智能
题解 | #坐标移动#
要判断是否为空,否则 i[0]有问题 判断 i[1:]是否为数字(is.digit()), 否则也会报错 while True: try: pos=[0,0] s=input().split(";") alpha = ['A','S','W','D'] for i in s: if i == '': continue alp = i[0] num = i[1:] if alp in alpha ...
0
点赞
评论
收藏
分享
2022-02-11 19:46
已编辑
Technische Universität Darmstadt 人工智能
题解 | #查找兄弟单词#
一个更简单的做法: while True: try: s = input().split(" ") n = int(s[0]) k = int(s[-1]) sub_str = s[-2] sum_str=[] for item in s[1:-2]: if item != sub_str and sorted(item)==sorted(sub_str): sum_str.append(item) ...
0
点赞
评论
收藏
分享
2022-02-10 20:18
Technische Universität Darmstadt 人工智能
题解 | #求最大连续bit数#
while True: try: s = bin(int(input()))[2:]+'E' t=[] max_num=0 for i in range(len(s)): if s[i]=='1': num=0 for j in range(i,len(s)): if s[j]=='1': num+=1 els...
0
点赞
评论
收藏
分享
2022-02-10 19:55
Technische Universität Darmstadt 人工智能
题解 | #求int型正整数在内存中存储时1的个数#
while True: try: s= int(input()) s=bin(s) print(s.count('1')) except: break python种用bin(number)可直接转换为2进制
0
点赞
评论
收藏
分享
2022-02-10 19:29
Technische Universität Darmstadt 人工智能
2022-02-10
在牛客打卡5天,今天学习:刷题 5 道/代码提交 11 次
每日监督打卡
0
点赞
评论
收藏
分享
2022-02-10 19:28
Technische Universität Darmstadt 人工智能
题解 | python Eval()函数运用#四则运算#
while True: try: s= input() s=s.replace('{', '(').replace('}', ')').replace('[', '(').replace(']',')') print(int(eval(s))) except: break
0
点赞
评论
收藏
分享
1
2
3
4
5
创作者周榜
更多
关注他的用户也关注了:
牛客网
牛客企业服务