摘要: Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You m 阅读全文
posted @ 2018-04-07 11:03 Nlifea 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Many of us had played the game "Battle city" in our childhood, and some people (like me) even often play it on computer now. What we are discussing is 阅读全文
posted @ 2018-04-04 22:29 Nlifea 阅读(107) 评论(0) 推荐(0) 编辑
摘要: You have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to school every day, you now get to 阅读全文
posted @ 2018-04-04 20:51 Nlifea 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 给你一个3*3的矩阵,请你给矩阵上色。其中有红绿蓝三种颜色可以选择,要求是相邻的两个点之间不能选择同一种颜色。问总共有几种上色方式? 用三进制的数组记录,然后暴力,没错就是这么粗暴 代码如下: 阅读全文
posted @ 2018-04-03 19:24 Nlifea 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 一道图论题, 首先,英语限制了我的做题,百度翻译垃圾了翻译的不知道是啥,烦得很然后去搜索了大神的博客, Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is s 阅读全文
posted @ 2018-04-03 09:19 Nlifea 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 最近做图论的题很是心塞,在做这道题的时候去百度了大神的博客,发现大神真心的任性,理解的透彻,dijkstra可以随便改,这篇博客在参考大神后,在自己的理解上,加以改动,顺便附上详细的解释,,, One cow from each of N farms (1 ≤ N ≤ 1000) convenien 阅读全文
posted @ 2018-04-02 22:58 Nlifea 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 标题:等差素数列2,3,5,7,11,13,....是素数序列。类似:7,37,67,97,127,157 这样完全由素数组成的等差数列,叫等差素数数列。上边的数列公差为30,长度为6。2004年,格林与华人陶哲轩合作证明了:存在任意长度的素数等差数列。这是数论领域一项惊人的成果!有这一理论为基础, 阅读全文
posted @ 2018-03-31 17:55 Nlifea 阅读(467) 评论(2) 推荐(0) 编辑
摘要: 对于该题可能很多人都很容易想到暴力,但是往往暴力很容易超时,因此我们需要想一个新的方法来解决。 干货(树状数组)为什莫用树状数组呢? 因为时间复杂度,lgn.每次查询消耗时间少, 核心代码如下: 敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory L 阅读全文
posted @ 2018-03-30 20:54 Nlifea 阅读(78) 评论(0) 推荐(0) 编辑
摘要: 7-9 List Leaves(25 分) Given a tree, you are supposed to list all the leaves in the order of top down, and left to right. Input Specification: Each inp 阅读全文
posted @ 2018-03-28 22:27 Nlifea 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 7-11 How Long Does It Take(25 分) Given the relations of all the activities of a project, you are supposed to find the earliest completion time of the 阅读全文
posted @ 2018-03-28 15:48 Nlifea 阅读(189) 评论(0) 推荐(0) 编辑