题目链接: D. As Fast As Possible time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output On vacations n pupils decided to go on excursion and gather all together. They need to overcome the path with th…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output On vacations n pupils decided to go on excursion and gather all together. They need to overcome the path with the length l meters. Each of the pu…
[Codeforces 865C]Gotta Go Fast(期望dp+二分答案) 题面 一个游戏一共有n个关卡,对于第i关,用a[i]时间通过的概率为p[i],用b[i]通过的时间为1-p[i],每通过一关后可以选择继续下一关或者时间清0并从第一关开始,先要求通过所有关卡的时间和不能超过R才算彻底通关,问直到彻底通关位置的游戏时间的期望值为多少 分析 二分从头开始通关的用时期望mid 设\(dp[i][j]\)表示通前i关,当前时间为j的期望,倒推期望. 若超时重新开始,则\(dp[i][j]…
D. As Fast As Possible 参考:https://blog.csdn.net/keyboardmagician/article/details/52769493 题意: 一群大佬要走L米,途中可以直接上车,大佬的速度为v1,车的速度为v2,车的位子有限,问大佬们到终点的时间最快是多少. 每个人只能坐一次车. 思路: 这类奥数题真难.有一个比较重要的转化,就是在设定的t时间下,公交车的时间就是全部大佬到终点的时间. 每个人只能坐一次车,所以最后到达终点的人决定总时间,可以看出,用…
You're trying to set the record on your favorite video game. The game consists of N levels, which must be completed sequentially in order to beat the game. You usually complete each level as fast as possible, but sometimes finish a level slower. Spec…
E. Sum of Remainders 题目连接: http://www.codeforces.com/contest/616/problem/E Description The only line contains two integers n, m (1 ≤ n, m ≤ 1013) - the parameters of the sum. input The only line contains two integers n, m (1 ≤ n, m ≤ 1013) - the para…
数学so奇妙.. 这题肯定会有一个循环节 就是最小公倍数 对于公倍数内的相同的数的判断 就要借助最大公约数了 想想可以想明白 #include <iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<stdlib.h> #include<vector> using namespace std; #define N 1000100 #defin…
C. Do you want a date? time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Leha decided to move to a quiet town Vičkopolis, because he was tired by living in Bankopolis. Upon arrival he immedi…
The least round way 题目链接:http://codeforces.com/contest/2/problem/B ——每天在线,欢迎留言谈论.PS.本题有什么想法.建议.疑问 欢迎留言!! 题目大意: ①第一行给你一个n,表示接下来将给你一个n阶方阵的数据 ②要求你从左上方出发到右下方,路径上所有数字乘积 的末尾0的个数最少 ③输出最少0的个数,并输出路径 PS:①每次只能向右或向走 ②D表示向下走,R表示向右 ③0乘任何数的结果 末尾都是一个0: 知识点: ①多个数字相乘,…
C. Fly time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Natasha is going to fly on a rocket to Mars and return to Earth. Also, on the way to Mars, she will land on n−2n−2 intermediate planet…