题集链接: https://cn.vjudge.net/contest/231988 解题之前请先了解组合数取模和Lucas定理 A : FZU-2020 输出组合数C(n, m) mod p (1 <= m <= n <= 10^9, m <= 10^4, m < p < 10^9, p是素数) 由于p较大,不可以打表,直接Lucas求解 #include<iostream> using namespace std; typedef long long…
题集见大佬博客 不要62 入门题,检验刚才自己有没有看懂 注意一些细节. 的确挺套路的 #include<bits/stdc++.h> #define REP(i, a, b) for(register int i = (a); i < (b); i++) #define _for(i, a, b) for(register int i = (a); i <= (b); i++) using namespace std; ; int a[MAXN], dp[MAXN][MAXN][…
转自:http://blog.csdn.net/shahdza/article/details/7779230 [HDU]1213 How Many Tables 基础并查集★1272 小希的迷宫 基础并查集★1325&&poj1308 Is It A Tree? 基础并查集★1856 More is better 基础并查集★1102 Constructing Roads 基础最小生成树★1232 畅通工程 基础并查集★2120 Ice_cream's world I 基础并查集★212…
FFT学习参考这两篇博客,很详细,结合这看,互补. 博客一 博客二 很大一部分题目需要构造多项式相乘来进行计数问题. 1. HDU 1402 A * B Problem Plus 把A和B分别当作多项式的系数. #include <cstdio> #include <algorithm> #include <cmath> #include <cstring> using namespace std; const double PI = acos(-1.0);…
noi 1996 登山 noi 8780 拦截导弹 noi 4977 怪盗基德的滑翔翼 noi 6045 开餐馆 noi 2718 移动路线 noi 2728 摘花生 noi 2985 数字组合 noi 6049 买书 noi 666 放苹果 noi 8787 数的划分 noi 9267 核电站 noi 1944 吃糖果 noi 8462 大盗阿福 noi 4982 踩方格 noi 9271 奶牛散步 noi 9268 酒鬼 noi 9265 取数游戏 noi 4978 宠物小精灵之收服 noi…
转自:http://blog.csdn.net/shahdza/article/details/7779324 [HDU]2255 奔小康赚大钱 模板题★1533 Going Home 模板题★2426 Interesting Housing Problem KM★3395 Special Fish KM★2282 Chocolate KM★2813 One fihgt one KM★1853 Cyclic Tour 最小费用圈覆盖★★3488 Tour 最小费用圈覆盖★★3435 A new…
Title: Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) You have the following 3 operations permitted on a word: a) Insert a characterb) Delete a characterc)…
HDU 1087 Input contains multiple test cases. Each test case is described in a line as follow:N value_1 value_2 …value_N It is guarantied that N is not more than 1000 and all value_i are in the range of 32-int.A test case starting with 0 terminates th…
简直智障,上一题V题,样例输出里面的“Case:”不要输出,到了这题又是要输出的了 #include<iostream> using namespace std; int num[100000]; int main() { int T; for(int i=32;i<100;i++){ num[i*i]=1; } cin>>T; int n; int k=0; while(T--){ cin>>n; k++; int a,b,c,d; a=n/1000; b=n/…