摘要:A直接暴力好了。 1 #include 2 typedef long long ll; 3 using namespace std; 4 5 int pan(ll x) 6 { 7 while (x) 8 { 9 if (x%10==8) return 1;10 ...
阅读全文
摘要:这是树链剖分的入门题,也是我学树链剖分的第一题。树链剖分:就是把树中和线段树联系起来,求(u,v)路径中权值的最大值和其路径的权值和。入门blog:http://blog.sina.com.cn/s/blog_7a1746820100wp67.html https://quartergeek...
阅读全文
摘要:整理上次写的题目:A:For a positive integernlet's define a functionf:f(n) = - 1 + 2 - 3 + .. + ( - 1)nnYour task is to calculatef(n)for a given integern.InputT...
阅读全文
摘要:NICE 的DP 题,明白了题解真是不错。Time Limit:10 SecMemory Limit:162 MBSubmit:1228Solved:622[Submit][Status]Description这里有一个n*m的矩阵,请你选出其中k个子矩阵,使得这个k个子矩阵分值之和最大。注意:选出...
阅读全文
摘要:暴力题,N 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 double dfs(double x,double y,int n) 9 {10 if (n==1) return max(x/y,y/...
阅读全文
摘要:1051: [HAOI2006]受欢迎的牛Time Limit:10 SecMemory Limit:162 MBSubmit:2276Solved:1190[Submit][Status]Description每一头牛的愿望就是变成一头最受欢迎的牛。现在有N头牛,给你M对整数(A,B),表示牛A认...
阅读全文
摘要:1029: [JSOI2007]建筑抢修Time Limit:4 SecMemory Limit:162 MBSubmit:2285Solved:1004[Submit][Status]Description小刚在玩JSOI提供的一个称之为“建筑抢修”的电脑游戏:经过了一场激烈的战斗,T部落消灭了所...
阅读全文
摘要:基础不牢:补莫队算法; 莫队算法入门题;2038: [2009国家集训队]小Z的袜子(hose)Time Limit:20 SecMemory Limit:259 MBSubmit:2616Solved:1182[Submit][Status]Description作为一个生活散漫的人,小Z...
阅读全文