摘要: 摇骰子。 #include<cstdio> inline bool valid(int x,int y,int n,char str[][55]){ return x>=0&&x<n&&y>=0&&y<n&&(str[x][y]=='#'||str[x][y]=='E'||str[x][y]=='S 阅读全文
posted @ 2020-04-27 20:41 kongbb 阅读(140) 评论(0) 推荐(0) 编辑
摘要: #include <map> #include <cmath> #include <queue> #include <string> #include <cstdio> #include <vector> #include <cstring> #include <iostream> #include 阅读全文
posted @ 2019-11-05 22:19 kongbb 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 某收费有线电视网计划转播一场重要的足球比赛。他们的转播网和用户终端构成一棵树状结构,这棵树的根结点位于足球比赛的现场,树叶为各个用户终端,其他中转站为该树的内部节点。 从转播站到转播站以及从转播站到所有用户终端的信号传输费用都是已知的,一场转播的总费用等于传输信号的费用总和。 现在每个用户都准备了一 阅读全文
posted @ 2019-08-16 22:41 kongbb 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 题目描述 一场可怕的地震后,人们用N个牲口棚(1≤N≤150,编号1..N)重建了农夫John的牧场。由于人们没有时间建设多余的道路,所以现在从一个牲口棚到另一个牲口棚的道路是惟一的。因此,牧场运输系统可以被构建成一棵树。John想要知道另一次地震会造成多严重的破坏。有些道路一旦被毁坏,就会使一棵含 阅读全文
posted @ 2019-08-16 20:47 kongbb 阅读(176) 评论(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 阅读(136) 评论(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 阅读(185) 评论(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 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 有 NN 个物品和一个容量是 VV 的背包。 物品之间具有依赖关系,且依赖关系组成一棵树的形状。如果选择一个物品,则必须选择它的父节点。 如下图所示: 如果选择物品5,则必须选择物品1和2。这是因为2是5的父节点,1是2的父节点。 每件物品的编号是 ii,体积是 vivi,价值是 wiwi,依赖的父 阅读全文
posted @ 2019-06-15 21:49 kongbb 阅读(332) 评论(0) 推荐(0) 编辑
摘要: 春节将至,小明要去超市购置年货,于是小明去了自己经常去的都尚超市。 刚到超市,小明就发现超市门口聚集一堆人。用白云女士的话说就是:“那家伙,那场面,真是人山人海,锣鼓喧天,鞭炮齐呤,红旗招展。那可真是相当的壮观啊!”。好奇的小明走过去,奋力挤过人群,发现超市门口贴了一张通知,内容如下: 值此新春佳节 阅读全文
posted @ 2019-06-13 16:12 kongbb 阅读(175) 评论(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 阅读(424) 评论(0) 推荐(0) 编辑