全部评论
凉凉,现在看到1000000007就害怕
1.[二进制求合](https://leetcode-cn.com/problems/add-binary/) 2.[找出只出现一次的数字](https://www.nowcoder.com/questionTerminal/e02fdb54d7524710a7d664d082bb7811) 3.[记票统计](https://www.nowcoder.com/questionTerminal/3350d379a5d44054b219de7af6708894) 是这三道题吗- -
太BT了吧这题 后三道全是数学题😂 我只知道第二题矩阵乘法加快速幂
https://blog.csdn.net/u014119694/article/details/99763922
a,b=map(int,input().split())
gua=[ [0] * 2 for i in range(a)]
for i in range(a):
gua[i-1][0],gua[i-1][1]=map(int,input().split())
gua.sort()
d=[0] * b
result=[-1] * b
for i in range(b):
n=int(input())
for j in range(len(gua)):
if(gua[j-1][0]>=n and gua[j-1][1]>result[i-1]):
result[i-1]=gua[j-1][1]
for i in range(b):
print(result[i-1])
# 80%
n, m = map(int, input().strip().split())
time_weights = []
for i in range(n):
p = list(map(int, input().strip().split()))
time_weights.append(p)
ds = []
for i in range(m):
d = int(input().strip())
ds.append(d)
result = []
for d in ds:
max_weight = 0
for item in time_weights:
if item[0] >= d and item[1] >= max_weight:
max_weight = item[1]
if max_weight == 0:
result.append(-1)
else:
result.append(max_weight)
for r in result:
print(r)
#20%,超内存
n, a, b, c, f0 = list(map(int, input().strip().split()))
f1 = a * f0 + 32768
f2 = a * f1 + b * f0 + 32773
f_n = [f0, f1, f2]
if n < 3:
print(f_n[n])
else:
for year in range(n-2):
money = a * f_n[year+2] + b * f_n[year+1] + c * f_n[year] + 2 * (year+3)**2 - (year+3) + 32767
f_n.append(money)
print(f_n[-1]) 超内存是因为把所有结果都保存到列表中了?
相关推荐
点赞 评论 收藏
分享
点赞 评论 收藏
分享