HDU5900】的更多相关文章

题目 Source http://acm.hdu.edu.cn/showproblem.php?pid=5900 Description Every school has some legends, Northeastern University is the same. Enter from the north gate of Northeastern University,You are facing the main building of Northeastern University.…
http://acm.hdu.edu.cn/showproblem.php?pid=5900 就是给出两行数字,每行有若干的数,如果相邻的两个数字的最大公约数不是1 的话拟具可以把这两数删除,并且把第二行对应的数字加起来,你的任务就是让这些数字的和最大 #include<stdio.h> #include<iostream> #include<algorithm> #include<string.h> using namespace std; int n;…
POJ2152 树形dp,每次先dfs一遍求出距离再枚举所有点转移即可. #include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<algorithm> using namespace std; inline int read() { ,f=; char ch=getchar(); ; ch=getchar();} +ch-'; ch=getcha…