随笔分类 -  ACM学习

摘要:某收费有线电视网计划转播一场重要的足球比赛。他们的转播网和用户终端构成一棵树状结构,这棵树的根结点位于足球比赛的现场,树叶为各个用户终端,其他中转站为该树的内部节点。 从转播站到转播站以及从转播站到所有用户终端的信号传输费用都是已知的,一场转播的总费用等于传输信号的费用总和。 现在每个用户都准备了一 阅读全文
posted @ 2019-08-16 22:41 kongbb 阅读(222) 评论(0) 推荐(0)
摘要:题目描述 一场可怕的地震后,人们用N个牲口棚(1≤N≤150,编号1..N)重建了农夫John的牧场。由于人们没有时间建设多余的道路,所以现在从一个牲口棚到另一个牲口棚的道路是惟一的。因此,牧场运输系统可以被构建成一棵树。John想要知道另一次地震会造成多严重的破坏。有些道路一旦被毁坏,就会使一棵含 阅读全文
posted @ 2019-08-16 20:47 kongbb 阅读(196) 评论(0) 推荐(0)
摘要:Given the sequence AA with nn integers t1,t2,⋯,tnt1,t2,⋯,tn. Given the integral coefficients aaand bb. The fact that select two elements titi and tjtj 阅读全文
posted @ 2019-08-13 22:33 kongbb 阅读(141) 评论(0) 推荐(0)
摘要:Tea is good. Tea is life. Tea is everything. The balance of tea is a journey of pursuing balance of the universe. Alice knows that. Alice wants to tea 阅读全文
posted @ 2019-08-13 20:47 kongbb 阅读(196) 评论(0) 推荐(0)
摘要:Problem Statement On a two-dimensional plane, there are m lines drawn parallel to the x axis, and nlines drawn parallel to the y axis. Among the lines 阅读全文
posted @ 2019-08-03 23:56 kongbb 阅读(184) 评论(0) 推荐(0)
摘要:有 NN 个物品和一个容量是 VV 的背包。 物品之间具有依赖关系,且依赖关系组成一棵树的形状。如果选择一个物品,则必须选择它的父节点。 如下图所示: 如果选择物品5,则必须选择物品1和2。这是因为2是5的父节点,1是2的父节点。 每件物品的编号是 ii,体积是 vivi,价值是 wiwi,依赖的父 阅读全文
posted @ 2019-06-15 21:49 kongbb 阅读(337) 评论(0) 推荐(0)
摘要:春节将至,小明要去超市购置年货,于是小明去了自己经常去的都尚超市。 刚到超市,小明就发现超市门口聚集一堆人。用白云女士的话说就是:“那家伙,那场面,真是人山人海,锣鼓喧天,鞭炮齐呤,红旗招展。那可真是相当的壮观啊!”。好奇的小明走过去,奋力挤过人群,发现超市门口贴了一张通知,内容如下: 值此新春佳节 阅读全文
posted @ 2019-06-13 16:12 kongbb 阅读(182) 评论(0) 推荐(0)
摘要:Sample Input Sample Output #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int cash, n; int c[15],w[15]; int dp[100005]; v 阅读全文
posted @ 2019-05-28 18:26 kongbb 阅读(434) 评论(0) 推荐(0)
摘要:Sample Input Sample Output 14050 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int maxn = 5e4+5; int w[15],v[15]; 阅读全文
posted @ 2019-05-28 16:28 kongbb 阅读(194) 评论(0) 推荐(0)
摘要:The title of this problem is familiar,isn't it?yeah,if you had took part in the "Rookie Cup" competition,you must have seem this title.If you haven't 阅读全文
posted @ 2019-05-26 21:23 kongbb 阅读(142) 评论(0) 推荐(0)
摘要:Problem Description 不知道大家有没有玩过一个叫做 九连环 的玩具,如下图所示。 如果你不了解九连环,那玄黄就带你领略九连环的奥妙: 九连环是我国传统的民间智力玩具,玩具上面有九个连环套在杆上,目标就是通过一定的方式将九个连环从杆上全部取下来。 玩法是这样的: 1、对每个环,有2种 阅读全文
posted @ 2019-05-26 21:19 kongbb 阅读(185) 评论(0) 推荐(0)
摘要:Balanced numbers have been used by mathematicians for centuries. A positive integer is considered a balanced number if: 1) Every even digit appears an 阅读全文
posted @ 2019-05-16 22:09 kongbb 阅读(159) 评论(0) 推荐(0)
摘要:soda has an integer array a1,a2,…,ana1,a2,…,an. Let S(i,j)S(i,j) be the sum of ai,ai+1,…,ajai,ai+1,…,aj. Now soda wants to know the value below: ∑i=1n 阅读全文
posted @ 2019-05-16 16:16 kongbb 阅读(166) 评论(0) 推荐(0)
摘要:Recall the definition of the median of elements where is odd: sort these elements and the median is the -th largest element. In this problem, the exac 阅读全文
posted @ 2019-05-13 22:45 kongbb 阅读(558) 评论(0) 推荐(0)
摘要:11 号上午到了济南大学,然后就是。。。走了一个中午的路emmm。。。。。济南大学真大啊,我从西门走到12号教学楼,又走到西门的大礼堂,再走回12号教学楼,热身赛结束再走回西门的宾馆,两万的步数,到了宾馆我和许哥哥的衣服都湿了。我感觉曲师校园小还挺好的。看了一下知乎才知道,济南大学还有个更大的南校区 阅读全文
posted @ 2019-05-13 18:33 kongbb 阅读(628) 评论(0) 推荐(0)
摘要:#define xhxj (Xin Hang senior sister(学姐)) If you do not know xhxj, then carefully reading the entire description is very important. As the strongest f 阅读全文
posted @ 2019-05-09 15:35 kongbb 阅读(139) 评论(0) 推荐(0)
摘要:A balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, imagine each digit as a box wi 阅读全文
posted @ 2019-05-07 15:18 kongbb 阅读(109) 评论(0) 推荐(0)
摘要:C. Match Pointstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output You are given a set of points x1 阅读全文
posted @ 2019-05-04 21:51 kongbb 阅读(212) 评论(0) 推荐(0)
摘要:The 44th World Finals of the International Collegiate Programming Contest (ICPC 2020) will be held in Moscow, Russia. To celebrate this annual event f 阅读全文
posted @ 2019-05-03 19:16 kongbb 阅读(267) 评论(0) 推荐(0)
摘要:有一个N阶方阵 第i行,j列的值Aij =i2 + 100000 × i + j2 - 100000 × j + i × j,需要找出这个方阵的第M小值. 有一个N阶方阵 第i行,j列的值Aij =i2 + 100000 × i + j2 - 100000 × j + i × j,需要找出这个方阵的 阅读全文
posted @ 2019-05-01 17:13 kongbb 阅读(212) 评论(0) 推荐(0)