题目链接:https://vjudge.net/problem/LightOJ-1284 1284 - Lights inside 3D Grid PDF (English) Statistics Forum Time Limit: 4 second(s) Memory Limit: 32 MB You are given a 3D grid, which has dimensions X, Y and Z. Each of the X x Y x Z cells contains a l…
题面: You are given a 3D grid, which has dimensions X, Y and Z. Each of the X x Y x Z cells contains a light. Initially all lights are off. You will have K turns. In each of the K turns, .... 题意: 一个大立方体里面选择k次小的立方体,将小的立方体里面灯泡的开关按一下,问最后的小灯泡亮起的个数期望 思路: 单独…
You are given a 3D grid, which has dimensions X, Y and Z. Each of the X x Y x Z cells contains a light. Initially all lights are off. You will have K turns. In each of the K turns, You select a cell A randomly from the grid, You select a cell B rando…
Mr. Chopsticks is interested in random phenomena, and he conducts an experiment to study randomness. In the experiment, he throws n balls into m boxes in such a manner that each ball has equal probability of going to each boxes. After the experiment,…
链接:https://www.nowcoder.com/acm/contest/147/E 来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 Niuniu likes to play OSU! We simplify the game OSU to the following problem. Given n and m, there are n clicks. Each c…
题目描述 你分别有a.b.c个血量为1.2.3的奴隶主,假设英雄血量无限,问:如果对面下出一个K点攻击力的克苏恩,你的英雄期望会受到到多少伤害. 输入 输入包含多局游戏. 第一行包含一个整数 T (T<100) ,表示游戏的局数. 每局游戏仅占一行,包含四个非负整数 K, A, B 和 C ,表示克苏恩的攻击力是 K ,你有 A 个 1 点血量的奴隶 主, B 个 2 点血量的奴隶主, C 个 3 点血量的奴隶主. 保证 K 是小于 50 的正数, A+B+C 不超过 7 . 输出 对于每局游戏…
禁书目录 题目大意:清教需要定期给Index清除记忆,在此之前需要把当中的十万三千本禁书取出来......不幸的是,禁书一旦离开了Index就非常脆弱,具体来说,每一本禁书都有一个魔力值 ai ,其记载的内容是 bi ,取出后的 n 本不同的禁书形成了一个排列,如果说对于一本禁书 i ,其左边存在一本不弱于它的魔力值的禁书 j ,禁书 i 就会因为禁书 j 的影响而消失.求对于所有可能的禁书排列,能保留下来的记载内容的种类数之和.由于答案可能很大,只需要输出对998244353 取膜后的结果即可…
T1 chinese 根据他的问题i*f[i]我们容易联想到,答案其实是每种方案中每个点的贡献为1的加和 我们可以转变问题,每个点在所有方案的贡献 进而其实询问就是1-k的取值,有多少中方案再取个和 事实上这样做就是将每个点抽离出来,虽然每种方案中可能包含多个可行点,但是我们每次考虑的都只是一个点的贡献,所以正确 ps:指数不能取模 代码很短 1 #include<bits/stdc++.h> 2 #define int long long 3 using namespace std; 4…
#include <iostream> #include <stdio.h> #include <cstring> #include <math.h> using namespace std; double GetP(int x, int N) { )-)/N/N; } double P2E(double p, int k) { -pow(-*p, k))/; } double GetE(int N, int M, int P, int K) { doubl…
题目链接:LightOJ - 1030 Description You are in a cave, a long cave! The cave can be represented by a \(1 \times N\) grid. Each cell of the cave can contain any amount of gold. Initially you are in position \(1\). Now each turn you throw a perfect \(6\) s…