A.digits 2 传送门 题意:给你一个n,要求输出一个每一位数字之和能整除n且其本身也能整除n的数.n不超过100,要求的数不超过10000位数. 题解:直接将n输出n次. 代码: #include <bits/stdc++.h> #define ll long long using namespace std; int main() { int T,n; for (scanf("%d",&T);T--;) { scanf("%d",&am…
link 题目大意:给定你 n 个点的一棵树 (边有边权,边权有正负) 你需要移除 k 条边,并连接 k 条权值为 0 的边,使得连接之后树的直径最大 题解: 根据 [POI2015]MOD 那道题,显然我们应该找 k+1 条树上不相交的链,求这些链的长度之和最大值 k = 0 部分分:直接求树的直径 k = 1 部分分:把 MOD 那道题 或者点头网那个第一题粘过来就行了 k <= 100 部分分:我们也考虑树形dp 由于我们只需要把长度累加,我们考虑设 f[i][j][0/1/2] 代表以…
An easy problem Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5475 Description One day, a useless calculator was being built by Kuros. Let's assume that number X is showed on the screen of calculator. At first,…
Born Slippy 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5735 Description Professor Zhang has a rooted tree, whose vertices are conveniently labeled by 1,2,...,n. And the i-th vertex is assigned with weight wi. For each s∈{1,2,...,n}, Professor Zh…
1556: Jerry's trouble Time Limit: 10 Sec Memory Limit: 256 MBSubmit: 787 Solved: 317[Submit][Status][Web Board] Description Jerry is caught by Tom. He was penned up in one room with a door, which only can be opened by its code. The code is the answ…