随笔分类 - ACM学习
摘要:Median Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 12453 Accepted: 4357 Description Given N numbers, X1, X2, ... , XN, let us calculate
阅读全文
摘要:D. Beautiful Array time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given an arra
阅读全文
摘要:C. Problem for Nazar time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output C. Problem for Nazar
阅读全文
摘要:Tom owns a company and he is the boss. There are n staffs which are numbered from 1 to n in this company, and every staff has a ability. Now, Tom is g
阅读全文
摘要:E. Two Teams time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are nn students stand
阅读全文
摘要:就是统计1~n中出现的各个数字的次数,当然是在16进制下。 不过有个区间问题的小技巧,统计从 [x,y] 可以转换成 从 [1,y] 减去 [1,x-1]。 不过要分类讨论一下,因为有可能会出现溢出,从ffffffff +1 得到 00000000 就是溢出了。 因为 n < 1e9 所以只会溢出一
阅读全文
摘要:高斯消元和二进制枚举都可以做这道题。 这里是高斯消元的代码 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int a[35][35]; // int x[35]; // 记录答案 void in
阅读全文
摘要:从数组中选择几个数,要求他们的乘积可以开平方,问有多少种方案。 先将单个数拆分成质因子,对于这个数而言,那些指数为奇数的质因子会使这个数无法被开平方。 所以我们需要选择一个对应质因子指数为奇数的元素,将他们两个放在一个方案中,但是又有可能会引入其他的质因子。 这样就变成了求解行列式中自由变元的数量问
阅读全文
摘要:After having drifted about in a small boat for a couple of days, Akira Crusoe Maeda was finally cast ashore on a foggy island. Though he was exhausted
阅读全文
摘要:看一下中文版的题目就好,英文题目太晦涩了。 有两种方法可以解题 一种是贪心+优先队列 另一种是贪心+并查集 优先队列 需要说的都在代码注释里 #include<cstdio> #include<queue> #include<algorithm> using namespace std; struc
阅读全文
摘要:TT and FF are ... friends. Uh... very very good friends -________-b FF is a bad boy, he is always wooing TT to play the following game with him. This
阅读全文
摘要:Bessie noted that although humans have many universities they can attend, cows have none. To remedy this problem, she and her fellow cows formed a new
阅读全文
摘要:某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数
阅读全文
摘要:Bessie was poking around the ant hill one day watching the ants march to and fro while gathering food. She realized that many of the ants were sibling
阅读全文
摘要:"Fat and docile, big and dumb, they look so stupid, they aren't much fun..." - Cows with Guns by Dana Lyons The cows want to prove to the public that
阅读全文
摘要:大意 n件物品,第i件hi高,有ci件,最高的一件不能超过ai的高度。问最高能堆多高输入第一行,一个n 接下来每一行,为hi,ai,ci输出最高堆多高样例 输入 3 7 40 3 5 23 8 2 52 6 样例输出 48 (从下到上:3个2号,3个1号,6个3号) 多重背包 这是bool 数组记录
阅读全文
摘要:A straight dirt road connects two fields on FJ's farm, but it changes elevation more than FJ would like. His cows do not mind climbing up or down a si
阅读全文
摘要:People in Silverland use coins.They have coins of value A1,A2,A3...An Silverland dollar.One day Tony opened his money-box and found there were some co
阅读全文
摘要:Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is divisible by
阅读全文
摘要:Keeping track of all the cows can be a tricky task so Farmer John has installed a system to automate it. He has installed on each cow an electronic ID
阅读全文

浙公网安备 33010602011771号