03 2015 档案
摘要:题意:求出1^m+2^m+...n^m思路:直接套用模板#include#include#include#include#include#include#include#include#include#define LL long longusing namespace std;const LL m...
阅读全文
摘要:http://acm.csu.edu.cn/OnlineJudge/problem.php?cid=2071&pid=6题意:有一个由n个数组成的序列 要求出一个满足 max-min#include#include#include#include#include#include#include...
阅读全文
摘要:题意:需要从(0,0) 点 到(x,y) 修一段路 其中有n条和y轴平行的河 修路的单位成本c1 修桥的单位成本c2 问最小总成本为多少思路:把所有河合并 再三分桥的长度 求出最小成本#include#include#include#include#include#in...
阅读全文
摘要:题意:说有1*x和2*x的长方形(1和2只能作为宽 ) 有一个2*m的空间 问如何组合才能使m的值最小思路:对2x的长方形不需要得讨论 对1x的长方形的记录总长度 并01背包 找到最接近sum/2 的值#include#include#include#include#...
阅读全文
摘要:#include#include#include#includeusing namespace std;const int MAXN=1000000+5;struct road{ int f,t; int w;};road vil[MAXN];int fa[1000+5];int target[...
阅读全文
摘要:#include#include#include#include#include#include#include#include#include#define LL __int64using namespace std;const double EPS=1e-9;const int MAXN=100...
阅读全文
摘要:#include#include#include#include#includeusing namespace std;char str[20];int main(){ int n; int len,ans; int s1,s2; int i,j,k; while(sc...
阅读全文
摘要:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1536题意: 输入n个只为 0或1 的数 形成一个排列 再输入m个数 每个数代表 目标排列 (样例 1 0 0 1 0 1 1 3 2 目标排列有可能为 1 ...
阅读全文
摘要:#include#include#include#includeusing namespace std;struct Node{ int m; double p;};Node bank[200];double dp[100000];int main(){ int t,n; double p;...
阅读全文
摘要:#include #include #include#includeusing namespace std;struct Node{ int x,y; int rt;};Node node[200];int n,m;int cnt,gcnt,ans,ok,temp;char mat[12][12...
阅读全文
摘要:#include#include#include#include#includeusing namespace std;#define INF 10000000int a[3000];int now[3000];int dp[2000+100][2000+100];int main(){ int ...
阅读全文
摘要:http://acm.fzu.edu.cn/contest/problem.php?cid=134&sortid=9#include#include#include#include#includeusing namespace std;struct Node{ double x,y;};Node ...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1160#include #include #include #include #include using namespace std;struct Node{ int w,s,id,fa;};Node mi...
阅读全文
摘要:http://acm.csu.edu.cn/OnlineJudge/showsource.php?id=97625#include#include#include#includeusing namespace std;int a[200000];int main(){ int n,m; int ...
阅读全文
摘要:http://acm.csu.edu.cn/OnlineJudge/showsource.php?id=97234#include#include#include#include#includeusing namespace std;int main(){ //freopen("output.tx...
阅读全文
摘要:题意: 输入一行字符串 只包含大小写字母 可以使用shift 和 caps 键 切换大小写 问最少按几次键思路:if(str[i]>='A'&&str[i]#include#include#includeusing namespace std;int dp[200][5];char st...
阅读全文
摘要:#include#include#include#include#includeusing namespace std;int a[120],c[120];int dp[100000+100];int main(){ int n,m; int i,j,k; while(scanf("%d%d"...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1069#include#include#include#includeusing namespace std;struct Node{ int a,b,c,dp;};Node node[3000];int cmp...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1176#include#include#include#includeusing namespace std;int dp[100000+10][12];int mat[100000+10][12];int ma...
阅读全文
摘要:#include #include #include #include #include using namespace std;const int N = 111111;int topo[205];struct node{ char a[105];}e[105];int n;int g[30...
阅读全文
摘要:http://codeforces.com/contest/510/problem/B题意: n行 每行m个颜色 问相同的颜色能否构成环思路: 对没vis过的位置dfs 一直到满足条件为止#include#include#include#includeusing namespace std;char...
阅读全文

浙公网安备 33010602011771号