cf B. Number Busters】的更多相关文章

http://codeforces.com/contest/382/problem/B 题意:给你Aa,b,w,x,c,然后每经过1秒,c=c-1;  如果b>=x,b=b-x;否则 a=a-1,b=w-(x-b);  问经过多少秒c<=a; #include <cstdio> #include <cstring> #include <algorithm> #define ll __int64 using namespace std; ll a,b,w,x,…
Number Busters Time Limit: 1000ms Memory Limit: 262144KB This problem will be judged on CodeForces. Original ID: 382B64-bit integer IO format: %I64d      Java class name: (Any)   Arthur and Alexander are number busters. Today they've got a competitio…
传送门 可以理解为上一道题的扩展板.. 然后我们就可以YY出这样一个式子 ${\sum_{i=1}^a\sum_{j=1}^b\sum_{k=1}^cd(ijk)=\sum_{i=1}^a\sum_{j=1}^b\sum_{k=1}^c[gcd(i,j)=gcd(i,k)=gcd(j,k)=1]\lfloor\frac{a}{i}\rfloor\lfloor\frac{b}{j}\rfloor\lfloor\frac{c}{k}\rfloor}$ 然后我们枚举第一维,排除掉不和第一维互质的数大力…
                                                题目链接 #include<iostream> #include<string> using namespace std; int main() { int n; cin >> n; string a; cin >> a; int f[10]; for(int i = 1; i <= 9; i++) cin >> f[i]; for(int i…
挺水的一道题~ 拿全排列随便乘一下就好了. #include <cstdio> #include <algorithm> #define N 300004 #define ll long long #define mod 998244353 #define setIO(s) freopen(s".in","r",stdin) using namespace std; struct Node { int a,b; }t[N]; ll fac[N…
github传送门 项目相关要求 使用 -n 参数控制生成题目的个数.(实现) 使用 -r 参数控制题目中数值(自然数.真分数和真分数分母)的范围.(实现) 生成的题目中计算过程不能产生负数.(实现) 生成的题目中如果存在形如e1 ÷ e2的子表达式,那么其结果应是真分数.(实现) 每道题目中出现的运算符个数不超过3个.(实现) 程序一次运行生成的题目不能重复.(实现) 在生成题目的同时,计算出所有题目的答案,并存入执行程序的当前目录下的Answers.txt文件.(实现) 程序应能支持一万道题…
B. Lost Number[CF交互题 暴力] This is an interactive problem. Remember to flush your output while communicating with the testing program. You may use fflush(stdout) in C++, system.out.flush() in Java, stdout.flush() in Python or flush(output) in Pascal to…
CF - 392 C. Yet Another Number Sequence 题目传送门 这个题看了十几分钟直接看题解了,然后恍然大悟,发现纸笔难于描述于是乎用Tex把初始矩阵以及转移矩阵都敲了出来 \(n\le 1e17\) 这个数量级求前缀和,发现递推关系之后矩阵快速幂是可以求出来的,所以就尝试把\(A_i(k)\) 的递推式求出来. \[A_{i-1}(k) = F_{i-1} * (i-1) ^ k\\ A_{i-2}(k) = F_{i-2} * (i-2) ^ k \] \[\be…
Let's call a number k-good if it contains all digits not exceeding k (0, ..., k). You've got a number k and an array a containing n numbers. Find out how many k-good numbers are in a (count each number every time it occurs in array a). Input The firs…
CF 441E Description 一共执行\(k\)次,每次有\(p\%\)把\(x * 2\),有\((100 - p)\%\)把\(x + 1\).问二进制下\(x\)末尾期望\(0\)的个数. Solution 设\(f[i][j]\)为执行第\(i\)次后\(x + j\)末尾期望\(0\)的个数 加一:$f[i + 1][j - 1] = f[i + 1][j - 1] + (100 - p)% * f[i][j]; $ 乘二:\(f[i + 1][j * 2] = f[i +…