已经死了
已经死了
全部文章
分类
题解(13)
归档
标签
去牛客网
登录
/
注册
已经死了的博客
全部文章
(共17篇)
题解 | E题 两数之和做法
E题 两数之和做法 给定一个数组,求切两刀的方案数,使得三段中都至少有一个正数,且每段的和都相同 先求总和tot,然后判tot%3是不是等于0,不是则无解 有解时,我们选择枚举第二段的终点,两数之和的思路,哈希表维护第二段的起点个数 遍历到一个下标i时,首先右侧的所有数之和必须是tot//3,其次还...
Python3
2024-11-24
0
34
题解 | EG题解
晚上回来剩一个小时,cv了e题,干了一个小时的g,差一口气,虽然没a掉,但是我还是想写下题解,记录一下我的g杀马特解法 e题我某次在刷一场div3的d还是e的时候,读题读假了,读成了今天的e题版本,然后我想出了正解,没地方交,后来网上搜的时候搜到了ecnu里有这题 https://ac...
Python3
2024-10-20
7
63
题解 | #困难数学题#
F题详细题解+拓展题单 在数组上移动,要从1走到n 在第i个下标,有p1[i]的概率走到i+1,有p2[i]的概率走到i,有p3[i]的概率走到i-1 下标1另外算,p的概率走到2,则1走到2的期望步数是1/p 求从...
Python3
2024-09-15
14
253
题解 | F题组合做法
F题组合做法 for i in range(n): for j in range(i): &nbs...
Python3
2024-09-08
8
134
题解 | 牛客周赛 Round 48 题解
小红的整数自增 x=list(map(int,input().split())) x.sort() res=(x[2]-x[0])+(x[2]-x[1]) print(res) 略 小红的01串取反 n=int(input()) s=[int(i) for&n...
Python3
2024-06-23
11
359
题解 | 牛客周赛 Round 47 题解
汗流浃背的一场,前一个小时出了2题,差点崩溃,还好稳定下来还是ak了小红的葫芦 from collections import Counter a=list(map(int,input().split())) cnt=Counter(a) if len(cnt)==2 and sorted(cnt....
Python3
2024-06-16
8
397
题解 | CDEF题解
CDEF题解 爱音开灯 class PrimeTable: def __init__(self, n=int((10**9)**0.5)+3) -> None: &n...
pypy3
Python3
2024-06-09
4
342
题解 | D和E 题解
小黑的区间 D-小黑的区间_牛客周赛 Round 45 (nowcoder.com) from collections import defaultdict,deque MI = lambda :map(int,input().s...
Python3
2024-06-02
3
202
题解 | 牛客周赛 Round 42
A 先手选n-1个就必胜,只有n=1的时候先手必败 s=input() if len(s)==1: print("yukari") else: print("kou") B模拟一下 mod=10**9+7 n=int(input()) a=li...
Python3
pypy3
2024-05-12
13
516
题解 | #小红的树上赋值(hard)#
F-小红的树上赋值(hard)_牛客周赛 Round 41 (nowcoder.com) from types import GeneratorType from collections import defaultdict de...
Python3
pypy3
2024-05-06
4
454
首页
上一页
1
2
下一页
末页