飞鸢泛惊鸿
飞鸢泛惊鸿
全部文章
分类
题解(2)
归档
标签
去牛客网
登录
/
注册
飞鸢泛惊鸿的博客
全部文章
(共18篇)
题解 | 绿豆蛙的归宿
message=[[0,0] for _ in range(n+1)]#值,概率message[1][1]=1先设最开始概率为1message[v][1]+=curr_g*(1/n)message[v][0]+=(curr_value/curr_g+w)*(1/n)*curr_gprint(&quo...
2026-04-09
3
28
题解 | 抽卡
这是一个概率问题,需要计算在每个卡池都单抽一次的情况下,至少抽到一张想要的卡的概率。由于是概率计算,且需要输出模意义下的结果,我们需要用组合数学和模运算的知识来解决。先想简单情况举个例子:池子1:3 种卡,你想要 1 种 → 抽一次,抽到你想要的概率是 1/3池子2:4 种卡,你想要 1 种 → 概...
2026-04-08
3
51
题解 | Kevin喜欢零(困难版本)
from typing import List, Optional from collections import deque, defaultdict, Counter import heapq import bisect import sys inf = float('inf') # inf=0...
2026-04-05
4
30
题解 | 小苯的ovo2.0
先全部改成o,然后二重循环枚举一个范围,将此范围改成v,然后计算取最大值同时可以在上一个答案大于本次计算答案时,退出循环 #include <iostream> #include <vector> #include <string> using namespace...
2026-03-30
3
32
题解 | 小苯的蓄水池(hard)
import sys input=sys.stdin.readline print=sys.stdout.write def _join(u,v): u_p,v_p=_find(u),_find(v) if u_p<v_p:v_p,u_p=u_p,v_p if u_p...
2026-03-09
3
60
题解 | 连分数
import sys input=sys.stdin.readline print=sys.stdout.write def compute(num,deno): integer=num//deno remain=num%deno if remain==0: ...
2026-03-08
3
51
题解 | 小红统计区间(easy)
import sys input=sys.stdin.readline n,k=map(int,input().split()) nums=list(map(int,input().split())) n=len(nums) l=0 total=0 ans=0 for r in range(...
2026-02-23
3
56
题解 | 小红的数组清空
from collections import Counter input() nums=list(map(int,input().split())) ans=0 prev_cnt=0 prev_key=-1 cnt=Counter(nums) for i in sorted(cnt.keys())...
2026-02-09
3
62
首页
上一页
1
2
下一页
末页