codeforces768D(87/600)

Gemini Ultra技术报告深度解析:多模态AI的范式重构与工程实践 多模态AI正从简单特征拼接迈向语义统一建模,其核心在于跨模态理解能力与可落地的工程架构设计。Gemini系列通过CMDH(跨模态蒸馏头)将文本、图像、音频、视频映射至共享概念空间,实现零样本迁移与训练稳定性提升;结合分阶段后训练、动态稀疏门控、模块化解码器等创新,兼顾性能、延迟与安全可控性。该技术路径不仅支撑了Gemini Ultra在MMLU等基准上的突破,更在DocVQA、Codeforces等真实任务中揭示出领域适配、结构理解与长程一致性等关键挑战。面向开发者与技术决策者,理解其底层范式比追逐参数规模 阅读详情

D. Jon and Orbs
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard output
Jon Snow is on the lookout for some orbs required to defeat the white walkers. There are k different types of orbs and he needs at least one of each. One orb spawns daily at the base of a Weirwood tree north of the wall. The probability of this orb being of any kind is equal. As the north of wall is full of dangers, he wants to know the minimum number of days he should wait before sending a ranger to collect the orbs such that the probability of him getting at least one of each kind of orb is at least , where ε < 10 - 7.

To better prepare himself, he wants to know the answer for q different values of pi. Since he is busy designing the battle strategy with Sam, he asks you for your help.

Input
First line consists of two space separated integers k, q (1 ≤ k, q ≤ 1000) — number of different kinds of orbs and number of queries respectively.

Each of the next q lines contain a single integer pi (1 ≤ pi ≤ 1000) — i-th query.

Output
Output q lines. On i-th of them output single integer — answer for i-th query.

Examples
input
1 1
1
output
1
input
2 2
1
2
output
2
2

这题明明就是能直接算出来…
非要dp…
行吧

就是水题

#include<bits/stdc++.h>
using namespace std;
#define int long long 
int k;
double eps=1e-5;
bool jiance(int x,int pp)
{
    int y=x-k+1;
    double gl=1;
    for(int a=1;a<=k;a++,y++)
    {
        gl*=y;
        if(a%2==0)gl/=(k*k);
    }
    if(k%2)gl/=k;
    if(gl>=double(pp)/2000.0)return 1;
    return 0;
}
double dp[10003][1000];
main()
{
    cin>>k;
    int q,w;
    cin>>q;
    dp[0][0]=1;
    for(int a=1;a<=8000;a++)
    {
        for(int b=1;b<=k;b++)
        {
            dp[a][b]=dp[a-1][b-1]*(k-b+1)/k+dp[a-1][b]*b/k;
        }
        if(dp[a][k]>0.5)break;
    }
    for(int a=1;a<=q;a++)
    {
        int w;
        cin>>w;
        for(int b=k;;b++)
        {
            if(dp[b][k]*2000>=w)
            {
                cout<<b<<endl;
                break;
            }
        }
    }
}
Prometheus常用配置介绍 除了 scrape_configs 外,上部还有 global 和 rule_files 部分, 其中 global 中 是 全 局 参 数 , scrape_interval 指 定 全 局 默 认 的 时 间 间 隔 , evaluation_interval 指定告警规则校验的时间间隔,rule_files 指定了告警规 则文件的位置名称。• annotations(注释):它们被用于存储更长的其他信息,例如警报描述 或者链接,注释值也可以被模板化。• alert:告警的名称。 阅读详情

相关推荐

FLUKA软件在Ubuntu的安装指南(亲测有效)

FLUKA其强大的蒙特卡洛模拟能力使得用户能够模拟复杂的辐射相互作用过程

chencheng1127的博客 2915

D. Jon and Orbs (概率dp)

D. Jon and Orbs (概率dp) 题意:给定kkk种龙晶,qqq个询问,每天产生一种龙晶,产生每种龙晶概率相等,每个询问给定ppp,求产生kkk种龙晶的概率≥(p−ε)2000\ge \dfrac{(p-\varepsilon)}{2000}≥2000(p−ε)​ 的最小天数。 思路:概率dpdpdp,令dp[i][j]dp[i][j]dp[i][j]表示第iii天产生jjj种龙晶的概率,有转移方程:dp[i][j]=dp[i−1][j]×jk+dp[i−1][j−1]×k−(j−1)kdp

Harris-H的博客 725

ComfyUI入门学习-教程篇

深入的 ComfyUI 教程,不同功能节点的详细指南。一个比较有意思的Comfyui教程,动画式学习。从安装到基础教程、高级教程再到各种工作流。非常全面,有教程有搭建好的工作流。

wincyfu的博客 1369

CodeForces 768 D Jon and Orbs(概率DP)

CodeForces 768 D Jon and Orbs题解

祝如愿的博客 188

Windows Server+SqlServer Always On实战:5步搞定高可用集群搭建

本文详细介绍了在Windows Server环境中,通过5个关键步骤搭建SQL Server Always On高可用集群的实战指南。内容涵盖从底层故障转移集群配置、SQL Server实例启用Always On功能,到创建可用性组和侦听器的完整流程,并提供了核心运维与故障排查思路,帮助企业构建稳定可靠的数据库高可用架构。

milk5的博客 879

linux下载NCBI基因组数据

fastq-dump --gzip --split-3 SRR25474921.sra,#使用fastq-dump将sra转换为fastq格式,--split-3 参数可以把双端测序的reads提取出来,左端标示为*_1.fastq;右端标示为*_2.fastq。安装之后转到NCBI网页搜索需要的数据或者到SRA数据中查找,我下载的是SRA数据库中的SRR25474921(SRA中是原始测序数据)prefetch --option-file SRR_Acc_List.txt #下载多个SRA文件。

k7586556的博客 2311

Codeforces768 D. Jon and Orbs(概率dp)

题意: 有n种物品,每种无限个,每天你可以随机等概率取出一个物品,可能抽到已有种类的物品。 q组询问,每组询问给出一个p,要求找到一个最小的x, 满足在第x天抽到n种物品的概率>=p/2000。 数据范围:n,q<=1e3,p<=1e3 解法: 令d[i][j]表示i天选出j种的概率. O(1e4*n)预处理出前1e4天的, 为什么是前1e4天呢,因为p<=1e3,那么p/2000<=0.5, 而1e4足够大,对于所有p都能计算出答案,d[1e4][1e3]已经大于0.9了.

zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz 227

【生物识别模组介绍】静脉识别模组

静脉识别技术是依据流动的静脉血液中的血红蛋白对近红外光有所吸收,通过近红外光照射手指、手掌、面部、腕部呈现的分布图像,再使用特定的算法对图像进行特征提取、分析比对,从而进行身份认证识别。静脉结构相同几率为34亿分之一,每个人的静脉结构具有独特性,而且静脉特征图像自成年后终身不变,不受外部环境、疾病等影响,是人体最稳定的生物特征之一。商务合作联系:newmagicmission@gmail.com图1.0。

upupDay's blog 914

Codeforces Round #399 (Div. 1 + Div. 2, combined) D题Jon and Orbs(dp)解题报告

Jon Snow is on the lookout for some orbs required to defeat the white walkers. There arekdifferent types of orbs and he needs at least one of each. One orb spawns daily at the base of a Weirwood tre...

weixin_30678821的博客 141

Arduino ESP32S3 基础入门教学大纲

ESP32环境、Arduino

追梦 3564

WPF+MVVM案例实战(二十三)- 阴影效果详解

通过附加属性实现阴影效果,通过改变不同的阴影属性值达到不同阴影效果

lingshuangcanxue 566

Codeforces Round #399:D. Jon and Orbs

D. Jon and Orbs time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Jon Snow is on the lookout for some orbs re

加载中... 777

基于LLaMA-action模型的文档摘要任务微调

文档摘要是指从长文档中提取关键信息,生成简短而准确的总结。抽取式摘要:从原文中直接抽取关键句子或短语组成摘要。生成式摘要:通过生成新的句子来表达原文的核心内容。混合式摘要:结合抽取式和生成式方法,既保留原文的关键句子,又生成新的内容。新闻网站:自动生成新闻摘要,帮助用户快速了解新闻要点。社交媒体:为用户提供新闻摘要,便于分享和传播。学术搜索引擎:为用户提供学术文献的摘要,帮助用户快速筛选相关文献。学术写作辅助:帮助研究人员快速生成文献综述部分。企业内部文档管理:自动生成文档摘要,便于员工快速了解文档内容。

加入“Super Entity”,与全能开发团队共探AI智能体与数字人项目,开启前沿技术之旅。 1436

CodeForces-768D Jon and Orbs

Jon and Orbs 题目 样例 思路 第i天出现j个orb的可能=第i-1天出现j种orb的可能*j种已有orb+第i-1天出现j-1种orb的可能 *未出现orb种类数。 代码 #include<iostream> using namespace std; long long num[1005]; double dp[10005][1005];//i天出现j种orb in...

shidonghang的博客 224

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

D. Jon and Orbs(概率dp,2200)

题目传送门 题意: 有k种球,每天等概率随机产生一种球,并且收集它。对于q次询问,每次询问一个p,问你至少多少天,你把k种球全部收集到的概率大于等于p2000\frac {p}{2000}2000p​ 。(k,q,p<=1000k,q,p<=1000k,q,p<=1000) 思路: 我们设f[i][j]f[i][j]f[i][j]为前iii天收集了jjj种蛋的概率,那么f[i][j]f[i][j]f[i][j]就有两种方式转移: [i≥j]:f[i][j]=f[i−1][j−1]+(k−

Joker_He的博客 319

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

codeforces-768D-Jon and Orbs(概率DP)

问题:http://codeforces.com/problemset/problem/768/D  题意:琼恩打败白色的步行者需要k中能量水晶,但是这k种水晶并不是按照一定顺序出现的,而是随机出现, 并且每种水晶出现的概率相同,琼恩想知道让每种水晶都至少有意见的概率大于P/2000至少需要多少天,共有 q次查询 题解:因为每种水晶出现是按照相同的概率的,很容易想到需要DP

信仰.的博客 773

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

codeforces 768D Jon and Orbs (概率dp)

题目原文:Jon Snow is on the lookout for some orbs required to defeat the white walkers. There are k different types of orbs and he needs at least one of each. One orb spawns daily at the base of a Weir

wchhlbt的博客 490

CF768D,概率DP

问题:http://codeforces.com/problemset/problem/768/D 题意:琼恩打败白色的步行者需要k中能量水晶,但是这k种水晶并不是按照一定顺序出现的,而是随机出现,并且每种水晶出现的概率相同,琼恩想知道让每种水晶都至少有一件的概率大于P/2000至少需要多少天,共有q次查询题解:因为每种水晶出现是按照相同的概率的,很容易想到需要DP一下,而且是概率DP。DP[i]...

qq_36876305的博客 298

Codeforces 768D Jon and Orbs (DP)

D. Jon and Orbs time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Jon Snow is on the lookout for some orbs r...

weixin_30315905的博客 162

codeforces 768D Jon and Orbs

题目链接:http://codeforces.com/problemset/problem/768/D题意:给你概率 p/2000 ,k种东西,每种东西取到的概率相同。q次询问问取多少次能使得每种东西至少一个的概率能达到给定值。k,q,p小于1000。题解:概率用dp递推,dp[i]代表 i 种颜色的概率,滚动此数组来模拟取的次数,记录dp[k]为每次的答案方便询问查询。 由于p范围概率最大为0.

zc74560的博客 235

Codeforces Round #399 D. Jon and Orbs(概率dp,好题)

题目链接 D. Jon and Orbs time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Jon Snow is on the lookout for some

fouzhe的博客 533

Codeforces #339 D. Jon and Orbs(概率dp)

D. Jon and Orbs time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Jon Snow is on the lookout for some orbs required to defeat the white walkers. There are k different types of orbs and he needs at lea

雪的期许 810

D. Jon and Orbs(概率dp)

D. Jon and Orbs time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Jon Snow is on the lookout for some orbs re

樱花满地集于我心,楪舞纷飞祈愿相随 652

CodeForces 768D : Jon and Orbs 概率DP

传送门 题意 分析 我们设f[i][j]f[i][j]f[i][j]表示第iii天取到jjj种球的概率,然后顺着推就好 因为f[i][j]f[i][j]f[i][j]只和f[i−1][k]f[i - 1][k]f[i−1][k]有关,所以可以用滚动数组来优化空间 代码 #pragma GCC optimize(3) #include <bits/stdc++.h> #define debug(x) cout<<#x<<":"<<x<<endl;

tlyzxc的博客 179

Codeforces 768D Jon and Orbs【概率Dp】

D. Jon and Orbs time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Jon Snow is on the lookout for some orbs required to

mengxiang000000 566

codeforces 768 D Jon and Orbs(概率dp)

题意: 琼恩要派遣游骑兵去鬼影森林获取龙晶,共有k种龙晶,鬼影森林每天产生一种龙晶,由于长城以北过于危险,所有琼恩想知道让每种龙晶都至少有一件的概率大于p/2000至少需要多少天.共有q次询问,琼恩忙于和山姆讨论战术,这些问题就交给你啦. 解题思路: 概率题不会啊,QAQ,好不容想懂了题意,但是不会. 不能理解题意的同学可以考虑,因为每天可能产生之前出现过的龙晶种类,所以即使k天也

johsnows的博客 1172
上一篇: codeforces822D (86/600)
下一篇: codeforces839B(88/600)
NineFailure
博客等级 码龄11年 22粉丝 317原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址