天了噜1999
天了噜1999
全部文章
分类
归档
标签
去牛客网
登录
/
注册
天了噜1999的博客
全部文章
(共7篇)
题解 | #罪犯转移#
while True: try: n, t, c = map(int, input().split()) persons = list(map(int, input().split())) pos = c tmp = sum(...
2024-04-13
0
67
题解 | #奖学金#
参考大佬代码,写一下python的 import collections while True: try: n, r, avg = map(int, input().split()) score, time = 0, 0 cost_time ...
2024-04-09
0
43
题解 | #循环数比较#
def repeat(x, k): return int(x * k) while True: try: x1, k1, x2, k2 = input().split() str1 = repeat(x1, int(k1)) str2...
2024-04-08
0
37
题解 | #获得最多的奖金#
利用双指针,可以看作是从两边分别求前缀和和后缀和,如果值相等就赋给结果res,如果左边大,就让右指针前进一步,同理,又变大,就让左指针前进一步。由于中间必须留至少一个红包,所以结束条件就是left + 1 <= right while True: try: n = in...
2024-04-07
0
49
题解 | #交叉线# python
input() while True: try: n = int(input().strip()) nums = list(map(int, input().split())) tmp = [] for i in range(...
2024-04-02
0
59
题解 | #最大差值#
class Solution: def getDis(self , A: List[int], n: int) -> int: # write code here num_min = A[0] res = 0 for i...
2024-04-01
1
57
题解 | #搬圆桌#
import math while True: try: r, x, y, x1, y1 = map(int, input().split()) distance = math.sqrt(pow(x - x1, 2) + pow(y - y1, 2)) ...
2024-03-30
1
62