TOJ 4689: Sawtooth】的更多相关文章

4689: Sawtooth Time Limit(Common/Java):1000MS/3000MS     Memory Limit:65536KByteTotal Submit: 26            Accepted:8 Description 给予一条直线,最多可以将一个无限大平面分为两块,而两条直线,最多可以将平面分为4块.嘛,稍稍提升些难度,若给予n个拥有m个锯齿的图形,最多能将平面分为几个区域呢? Input 多组测试数组.每组测试数据含有两个数m.n(1<=m<=10…
TOJ 2776题目链接http://acm.tju.edu.cn/toj/showp2776.html 这题其实就是考虑的周全性...  贡献了好几次WA, 后来想了半天才知道哪里有遗漏.最大的问题就是, 当零头是13的时候, 不一定前面的光盘都刻录到最大值.比如29,16这种情况, 如果前面的刻录最大值,这样就需要3个盘,而最少的却是 2个就够了,(15,14) 即可:知道这种情况,这题基本就可以了: 注意一下这几个数据: 13 15 输出为2 29 16 输出为2 这条题目看起来很容易,但…
Sawtooth Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 422    Accepted Submission(s): 134 Problem Description Think about a plane: ● One straight line can divide a plane into two regions. ● Tw…
2015-06-05 问题简述: 有一个 p*q 的棋盘,一个骑士(就是中国象棋里的马)想要走完所有的格子,棋盘横向是 A...Z(其中A开始 p 个),纵向是 1...q. 原题链接:http://acm.tju.edu.cn/toj/showp1702.html 解题思路: DFS:深搜把所有情况都考虑一遍,当骑士走出棋盘或走到原来走过的格子时,旅行失败了:当骑士能一直走下去直到走过的格子数等于 p*q 时,旅行成功. 提交过程中一直有一个问题使这个代码一直WA,最后才发现是 p.q输入反了…
2015-06-03 问题简述: 大概就是输入两段文本(用小写英文字母表示),分别用#表示一段话的结束输入,输出这两个文本的最长公共子序列. 简单的LCS问题,但是输入的是一段话了,而且公共部分比较是字符串的比较. 原题链接:http://acm.tju.edu.cn/toj/showp.php?pid=1139 解题思路: 简单的最长公共子序列问题,只不过过程中比较的是两个字符串,故使用二维字符数组保存输入文本. 输入 x[1...m][], y[1...n][] ,c[i,j]代表两个文本的…
这一片文章中我们介绍一下Hyperledger Sawtooth项目中所提出的PoET共识算法, 现有的区块链共识算法大概可以分为两种: Nakamoto consensus:通过乐透的方式选择出一个leader,由leader产生块添加到账本中.最典型的例子就是bitcoin,通过挖矿算法来选出一个leader(最先挖出块的节点),leader公布自己的块给其他的参与者,参与者决定是否将其加入到自己的链中,以及决定是否沿着该块继续向下挖掘,而这实际上是一种隐性投票. Byzantine Fau…
链接:http://acm.tju.edu.cn/toj/showp4123.html 4123.   Job Scheduling Time Limit: 1.0 Seconds   Memory Limit: 65536K Total Runs: 130   Accepted Runs: 29 Given N jobs, each denoted by a 2-tuples integer (pi, ri) where pi is the processing time and ri is…
链接http://acm.tju.edu.cn/toj/showp4117.html 4117.   Happy tree friends Time Limit: 1.0 Seconds   Memory Limit: 65536K Total Runs: 164   Accepted Runs: 60 yuebai has an undirected complete graph with n vertices. He wants to know the minimum spanning tr…
链接:http://acm.tju.edu.cn/toj/showp4120.html 4120.   Zombies VS Plants Time Limit: 1.0 Seconds   Memory Limit: 65536K Total Runs: 268   Accepted Runs: 36 tmeteorj recently is interested in a game Plants VS Zombies like following picture. And his brain…
It's not Floyd Algorithm 时间限制(普通/Java):1000MS/3000MS     运行内存限制:65536KByte   描述 When a directed graph is given, we can solve its transitive closure easily using the well-known Floyd algorithm. But if you're given a transitive closure, can you give a…