12 2018 档案

摘要:A positive integer xx is called a power of two if it can be represented as x=2yx=2y, where yy is a non-negative integer. So, the power... 阅读全文
posted @ 2018-12-28 16:31 black_hole6 阅读(369) 评论(0) 推荐(0)
摘要:The capital of Berland has n multifloor buildings. The architect who built up the capital was very creative, so all the houses were bu... 阅读全文
posted @ 2018-12-27 20:50 black_hole6 阅读(164) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/289/E来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述 要将n种物资分配到... 阅读全文
posted @ 2018-12-27 17:59 black_hole6 阅读(261) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/289/D来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld题目描述 小明在上学的... 阅读全文
posted @ 2018-12-27 11:44 black_hole6 阅读(263) 评论(0) 推荐(0)
摘要:time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp loves ciphers. He has in... 阅读全文
posted @ 2018-12-24 09:34 black_hole6 阅读(293) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/318/L来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述在国外,666代... 阅读全文
posted @ 2018-12-23 17:01 black_hole6 阅读(200) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/318/M来源:牛客网 在一次青青草原ACM个人赛中,潇洒哥被喜洋洋以30s罚时压制,委屈的当了个第二。潇洒哥蹲在角落说出了他的口头禅,并画起了圈圈。 突然,他想出了一个有趣的题目,... 阅读全文
posted @ 2018-12-23 16:59 black_hole6 阅读(295) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/318/A来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述 A... 阅读全文
posted @ 2018-12-23 16:53 black_hole6 阅读(128) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/321/D来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述买定离手,买定离手!... 阅读全文
posted @ 2018-12-22 16:30 black_hole6 阅读(351) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/321/B来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述没有选上课的孩子,或... 阅读全文
posted @ 2018-12-22 16:10 black_hole6 阅读(196) 评论(0) 推荐(0)
摘要:由于没报名,只能靠别人发的截图来做了我的思路:全排列,判断加号位置,判断/位置,看是否存在这个相等的时间复杂度较高,在10e8左右代码:#include#include#include#include#includeusing namespace std;int ma... 阅读全文
posted @ 2018-12-22 15:55 black_hole6 阅读(191) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/321/C来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld题目描述集训队里,有一位... 阅读全文
posted @ 2018-12-22 15:23 black_hole6 阅读(218) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/321/A来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述 “FF来训练!”“... 阅读全文
posted @ 2018-12-22 15:17 black_hole6 阅读(219) 评论(0) 推荐(0)
摘要:Berland, 2016. The exchange rate of currency you all know against the burle has increased so much that to simplify the calculations, i... 阅读全文
posted @ 2018-12-22 00:15 black_hole6 阅读(237) 评论(0) 推荐(0)
摘要:Amr loves Geometry. One day he came up with a very interesting problem.Amr has a circle of radius r and center in point (x, y). He wan... 阅读全文
posted @ 2018-12-21 23:05 black_hole6 阅读(195) 评论(0) 推荐(0)
摘要:Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko... 阅读全文
posted @ 2018-12-21 17:52 black_hole6 阅读(243) 评论(0) 推荐(0)
摘要:"QAQ" is a word to denote an expression of crying. Imagine "Q" as eyes with tears and "A" as a mouth.Now Diamond has given Bort a stri... 阅读全文
posted @ 2018-12-21 17:25 black_hole6 阅读(460) 评论(0) 推荐(0)
摘要:有了一张自驾旅游路线图,你会知道城市间的高速公路长度、以及该公路要收取的过路费。现在需要你写一个程序,帮助前来咨询的游客找一条出发地和目的地之间的最短路径。如果有若干条路径都是最短的,那么需要输出最便宜的一条路径。输入格式:输入说明:输入数据的第1行给出4个正整数N、... 阅读全文
posted @ 2018-12-20 16:45 black_hole6 阅读(345) 评论(0) 推荐(0)
摘要:Vova, the Ultimate Thule new shaman, wants to build a pipeline. As there are exactly n houses in Ultimate Thule, Vova wants the city t... 阅读全文
posted @ 2018-12-20 16:24 black_hole6 阅读(182) 评论(0) 推荐(0)
摘要:Vova, the Ultimate Thule new shaman, wants to build a pipeline. As there are exactly n houses in Ultimate Thule, Vova wants the city t... 阅读全文
posted @ 2018-12-20 16:24 black_hole6 阅读(244) 评论(0) 推荐(1)
摘要:New Year is coming in Line World! In this world, there are n cells numbered by integers from 1 to n, as a 1 × n board. People live in ... 阅读全文
posted @ 2018-12-20 15:56 black_hole6 阅读(133) 评论(0) 推荐(0)
摘要:New Year is coming in Line World! In this world, there are n cells numbered by integers from 1 to n, as a 1 × n board. People live in ... 阅读全文
posted @ 2018-12-20 15:56 black_hole6 阅读(158) 评论(0) 推荐(0)
摘要:Yaroslav has an array that consists of n integers. In one second Yaroslav can swap two neighboring array elements. Now Yaroslav is won... 阅读全文
posted @ 2018-12-20 15:14 black_hole6 阅读(276) 评论(0) 推荐(0)
摘要:Yaroslav has an array that consists of n integers. In one second Yaroslav can swap two neighboring array elements. Now Yaroslav is won... 阅读全文
posted @ 2018-12-20 15:14 black_hole6 阅读(214) 评论(0) 推荐(0)
摘要:There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this "How far ... 阅读全文
posted @ 2018-12-20 13:58 black_hole6 阅读(202) 评论(0) 推荐(0)
摘要:There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this "How far ... 阅读全文
posted @ 2018-12-20 13:58 black_hole6 阅读(183) 评论(0) 推荐(0)
摘要:Lele now is thinking about a simple function f(x). If x = 10 f(x) = a0 * f(x-1) + a1 * f(x-2) + a2 * f(x-3) + …… + a9 * f(x-10); And a... 阅读全文
posted @ 2018-12-19 23:19 black_hole6 阅读(160) 评论(0) 推荐(0)
摘要:Lele now is thinking about a simple function f(x). If x = 10 f(x) = a0 * f(x-1) + a1 * f(x-2) + a2 * f(x-3) + …… + a9 * f(x-10); And a... 阅读全文
posted @ 2018-12-19 23:19 black_hole6 阅读(147) 评论(0) 推荐(0)
摘要:英国天文学家爱丁顿很喜欢骑车。据说他为了炫耀自己的骑车功力,还定义了一个“爱丁顿数” E ,即满足有 E 天骑车超过 E 英里的最大整数 E。据说爱丁顿自己的 E 等于87。现给定某人 N 天的骑车距离,请你算出对应的爱丁顿数 E(≤N)。输入格式:输入第一行给出一个... 阅读全文
posted @ 2018-12-19 17:01 black_hole6 阅读(167) 评论(0) 推荐(0)
摘要:英国天文学家爱丁顿很喜欢骑车。据说他为了炫耀自己的骑车功力,还定义了一个“爱丁顿数” E ,即满足有 E 天骑车超过 E 英里的最大整数 E。据说爱丁顿自己的 E 等于87。现给定某人 N 天的骑车距离,请你算出对应的爱丁顿数 E(≤N)。输入格式:输入第一行给出一个... 阅读全文
posted @ 2018-12-19 17:01 black_hole6 阅读(395) 评论(0) 推荐(0)
摘要:time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVova's family is building the Gr... 阅读全文
posted @ 2018-12-19 16:32 black_hole6 阅读(128) 评论(0) 推荐(0)
摘要:time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVova's family is building the Gr... 阅读全文
posted @ 2018-12-19 16:32 black_hole6 阅读(194) 评论(0) 推荐(0)
摘要:time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are nn students in a univer... 阅读全文
posted @ 2018-12-19 16:11 black_hole6 阅读(162) 评论(0) 推荐(0)
摘要:time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are nn students in a univer... 阅读全文
posted @ 2018-12-19 16:11 black_hole6 阅读(159) 评论(0) 推荐(0)
摘要:time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two integers n and ... 阅读全文
posted @ 2018-12-19 16:07 black_hole6 阅读(206) 评论(0) 推荐(0)
摘要:time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two integers n and ... 阅读全文
posted @ 2018-12-19 16:07 black_hole6 阅读(145) 评论(0) 推荐(0)
摘要:Zane the wizard is going to perform a magic show shuffling the cups.There are n cups, numbered from 1 to n, placed along the x-axis on... 阅读全文
posted @ 2018-12-18 11:10 black_hole6 阅读(157) 评论(0) 推荐(0)
摘要:Zane the wizard is going to perform a magic show shuffling the cups.There are n cups, numbered from 1 to n, placed along the x-axis on... 阅读全文
posted @ 2018-12-18 11:10 black_hole6 阅读(147) 评论(0) 推荐(0)
摘要:Arpa is taking a geometry exam. Here is the last problem of the exam.You are given three points a, b, c.Find a point and an angle such... 阅读全文
posted @ 2018-12-18 09:55 black_hole6 阅读(248) 评论(0) 推荐(0)
摘要:Arpa is taking a geometry exam. Here is the last problem of the exam.You are given three points a, b, c.Find a point and an angle such... 阅读全文
posted @ 2018-12-18 09:55 black_hole6 阅读(202) 评论(0) 推荐(0)
摘要:Saitama accidentally destroyed a hotel again. To repay the hotel company, Genos has volunteered to operate an elevator in one of its o... 阅读全文
posted @ 2018-12-18 09:14 black_hole6 阅读(186) 评论(0) 推荐(0)
摘要:Saitama accidentally destroyed a hotel again. To repay the hotel company, Genos has volunteered to operate an elevator in one of its o... 阅读全文
posted @ 2018-12-18 09:14 black_hole6 阅读(189) 评论(0) 推荐(0)
摘要:Little girl Tanya climbs the stairs inside a multi-storey building. Every time Tanya climbs a stairway, she starts counting steps from... 阅读全文
posted @ 2018-12-17 23:35 black_hole6 阅读(194) 评论(0) 推荐(0)
摘要:Little girl Tanya climbs the stairs inside a multi-storey building. Every time Tanya climbs a stairway, she starts counting steps from... 阅读全文
posted @ 2018-12-17 23:35 black_hole6 阅读(253) 评论(0) 推荐(0)
摘要:看了一些别人的博客,发现里面涉及到的公式没有证明,于是就打算自己写一篇比较详细的讲解。先看两个引理及其证明(建议把证明搞懂)。PS:以下图片均为原作者用wps制作,如想使用请附上作者博客链接,谢谢O(∩_∩)O。 看完了上面的引理,那就可以正式开始Miller-Rab... 阅读全文
posted @ 2018-12-17 21:54 black_hole6 阅读(763) 评论(0) 推荐(0)
摘要:看了一些别人的博客,发现里面涉及到的公式没有证明,于是就打算自己写一篇比较详细的讲解。先看两个引理及其证明(建议把证明搞懂)。PS:以下图片均为原作者用wps制作,如想使用请附上作者博客链接,谢谢O(∩_∩)O。 看完了上面的引理,那就可以正式开始Miller-Rab... 阅读全文
posted @ 2018-12-17 21:54 black_hole6 阅读(492) 评论(0) 推荐(0)
摘要:Sonya decided that having her own hotel business is the best way of earning money because she can profit and rest wherever she wants.T... 阅读全文
posted @ 2018-12-17 21:39 black_hole6 阅读(164) 评论(0) 推荐(0)
摘要:Sonya decided that having her own hotel business is the best way of earning money because she can profit and rest wherever she wants.T... 阅读全文
posted @ 2018-12-17 21:39 black_hole6 阅读(217) 评论(0) 推荐(0)
摘要:You are given three integers aa, bb and xx. Your task is to construct a binary string ssof length n=a+bn=a+b such that there are exact... 阅读全文
posted @ 2018-12-17 21:03 black_hole6 阅读(169) 评论(0) 推荐(0)
摘要:You are given three integers aa, bb and xx. Your task is to construct a binary string ssof length n=a+bn=a+b such that there are exact... 阅读全文
posted @ 2018-12-17 21:03 black_hole6 阅读(261) 评论(0) 推荐(0)
摘要:time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputChouti and his classmates are goi... 阅读全文
posted @ 2018-12-17 09:44 black_hole6 阅读(246) 评论(0) 推荐(0)
摘要:time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputChouti and his classmates are goi... 阅读全文
posted @ 2018-12-17 09:44 black_hole6 阅读(164) 评论(0) 推荐(0)
摘要:time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputChouti was doing a competitive pr... 阅读全文
posted @ 2018-12-17 09:40 black_hole6 阅读(104) 评论(0) 推荐(0)
摘要:time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputChouti was doing a competitive pr... 阅读全文
posted @ 2018-12-17 09:40 black_hole6 阅读(174) 评论(0) 推荐(0)
摘要:time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMishka is trying really hard to ... 阅读全文
posted @ 2018-12-16 17:09 black_hole6 阅读(185) 评论(0) 推荐(0)
摘要:time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMishka is trying really hard to ... 阅读全文
posted @ 2018-12-16 17:09 black_hole6 阅读(179) 评论(0) 推荐(0)
摘要:time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a string ss consist... 阅读全文
posted @ 2018-12-16 00:52 black_hole6 阅读(192) 评论(0) 推荐(0)
摘要:time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a string ss consist... 阅读全文
posted @ 2018-12-16 00:52 black_hole6 阅读(275) 评论(0) 推荐(0)
摘要:time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMishka got a six-faced dice. It h... 阅读全文
posted @ 2018-12-16 00:49 black_hole6 阅读(262) 评论(0) 推荐(0)
摘要:time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMishka got a six-faced dice. It h... 阅读全文
posted @ 2018-12-16 00:49 black_hole6 阅读(167) 评论(0) 推荐(0)
摘要:Kevin has just recevied his disappointing results on the USA Identification of Cows Olympiad (USAICO) in the form of a binary string o... 阅读全文
posted @ 2018-12-15 16:36 black_hole6 阅读(213) 评论(0) 推荐(0)
摘要:Kevin has just recevied his disappointing results on the USA Identification of Cows Olympiad (USAICO) in the form of a binary string o... 阅读全文
posted @ 2018-12-15 16:36 black_hole6 阅读(150) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/297/D来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述旅行到K国的小w... 阅读全文
posted @ 2018-12-15 15:24 black_hole6 阅读(205) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/297/D来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述旅行到K国的小w... 阅读全文
posted @ 2018-12-15 15:24 black_hole6 阅读(255) 评论(0) 推荐(0)
摘要:N个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a #include#include#include#define maxn 50005using namespace std;int lazy[1000005],N;struct no... 阅读全文
posted @ 2018-12-15 11:22 black_hole6 阅读(212) 评论(0) 推荐(0)
摘要:N个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a #include#include#include#define maxn 50005using namespace std;int lazy[1000005],N;struct no... 阅读全文
posted @ 2018-12-15 11:22 black_hole6 阅读(163) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/297/C来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述小w有m条线段,... 阅读全文
posted @ 2018-12-15 10:58 black_hole6 阅读(145) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/297/C来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述小w有m条线段,... 阅读全文
posted @ 2018-12-15 10:58 black_hole6 阅读(174) 评论(0) 推荐(0)
摘要:一、差分数组的定义及用途1.定义:对于已知有n个元素的离线数列d,我们可以建立记录它每项与前一项差值的差分数组f:显然,f[1]=d[1]-0=d[1];对于整数i∈[2,n],我们让f[i]=d[i]-d[i-1]。2.简单性质:(1)计算数列各项的值:观察d[2]... 阅读全文
posted @ 2018-12-15 10:35 black_hole6 阅读(226) 评论(0) 推荐(0)
摘要:一、差分数组的定义及用途1.定义:对于已知有n个元素的离线数列d,我们可以建立记录它每项与前一项差值的差分数组f:显然,f[1]=d[1]-0=d[1];对于整数i∈[2,n],我们让f[i]=d[i]-d[i-1]。2.简单性质:(1)计算数列各项的值:观察d[2]... 阅读全文
posted @ 2018-12-15 10:35 black_hole6 阅读(258) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/297/B来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述小w与tokit... 阅读全文
posted @ 2018-12-14 21:04 black_hole6 阅读(219) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/297/B来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述小w与tokit... 阅读全文
posted @ 2018-12-14 21:04 black_hole6 阅读(241) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/297/A来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述 不知道你听没听... 阅读全文
posted @ 2018-12-14 21:01 black_hole6 阅读(270) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/297/A来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述 不知道你听没听... 阅读全文
posted @ 2018-12-14 21:01 black_hole6 阅读(226) 评论(0) 推荐(0)
摘要:Polycarp has nn coins, the value of the ii-th coin is aiai. Polycarp wants to distribute all the coins between his pockets, but he can... 阅读全文
posted @ 2018-12-14 18:02 black_hole6 阅读(139) 评论(0) 推荐(0)
摘要:Polycarp has nn coins, the value of the ii-th coin is aiai. Polycarp wants to distribute all the coins between his pockets, but he can... 阅读全文
posted @ 2018-12-14 18:02 black_hole6 阅读(277) 评论(0) 推荐(0)
摘要:Duff is addicted to meat! Malek wants to keep her happy for n days. In order to be happy in i-th day, she needs to eat exactly ai kilo... 阅读全文
posted @ 2018-12-14 11:13 black_hole6 阅读(229) 评论(0) 推荐(0)
摘要:Duff is addicted to meat! Malek wants to keep her happy for n days. In order to be happy in i-th day, she needs to eat exactly ai kilo... 阅读全文
posted @ 2018-12-14 11:13 black_hole6 阅读(161) 评论(0) 推荐(0)
摘要:Eugeny has array a = a1, a2, ..., an, consisting of n integers. Each integer ai equals to -1, or to 1. Also, he has m queries:Query nu... 阅读全文
posted @ 2018-12-14 10:49 black_hole6 阅读(238) 评论(0) 推荐(0)
摘要:Eugeny has array a = a1, a2, ..., an, consisting of n integers. Each integer ai equals to -1, or to 1. Also, he has m queries:Query nu... 阅读全文
posted @ 2018-12-14 10:49 black_hole6 阅读(144) 评论(0) 推荐(0)
摘要:The greatest common divisor GCD(a,b) of two positive integers a and b,sometimes written (a,b),is the largest divisor common to a and b... 阅读全文
posted @ 2018-12-13 21:45 black_hole6 阅读(193) 评论(0) 推荐(0)
摘要:The greatest common divisor GCD(a,b) of two positive integers a and b,sometimes written (a,b),is the largest divisor common to a and b... 阅读全文
posted @ 2018-12-13 21:45 black_hole6 阅读(173) 评论(0) 推荐(0)
摘要:欧拉函数证明: 小于等于n的基数有n个,讨论所有n的素因子,只要是素因子的倍数的是都不是n的互质数。首先如果如果n为素数那么,φ(n)=n-1;如果n不是素数,只要除去n的质因子和n的质因子的倍数就可以了,①因为任意一个数都能表示成若干个素数的乘积,所以只要除去质因... 阅读全文
posted @ 2018-12-13 21:22 black_hole6 阅读(170) 评论(0) 推荐(0)
摘要:欧拉函数证明: 小于等于n的基数有n个,讨论所有n的素因子,只要是素因子的倍数的是都不是n的互质数。首先如果如果n为素数那么,φ(n)=n-1;如果n不是素数,只要除去n的质因子和n的质因子的倍数就可以了,①因为任意一个数都能表示成若干个素数的乘积,所以只要除去质因... 阅读全文
posted @ 2018-12-13 21:22 black_hole6 阅读(139) 评论(0) 推荐(0)
摘要:证明方法用到容斥定理:容斥定理的原理如图: https://images2015.cnblogs.com/blog/962849/201612/962849-20161229152401367-2384105.png A∪B... 阅读全文
posted @ 2018-12-13 20:48 black_hole6 阅读(337) 评论(0) 推荐(0)
摘要:证明方法用到容斥定理:容斥定理的原理如图: https://images2015.cnblogs.com/blog/962849/201612/962849-20161229152401367-2384105.png A∪B... 阅读全文
posted @ 2018-12-13 20:48 black_hole6 阅读(260) 评论(0) 推荐(0)
摘要:7-31 朋友圈 (25 分)某学校有N个学生,形成M个俱乐部。每个俱乐部里的学生有着一定相似的兴趣爱好,形成一个朋友圈。一个学生可以同时属于若干个不同的俱乐部。根据“我的朋友的朋友也是我的朋友”这个推论可以得出,如果A和B是朋友,且B和C是朋友,则A和C也是朋友。请... 阅读全文
posted @ 2018-12-13 16:45 black_hole6 阅读(351) 评论(0) 推荐(0)
摘要:7-31 朋友圈 (25 分)某学校有N个学生,形成M个俱乐部。每个俱乐部里的学生有着一定相似的兴趣爱好,形成一个朋友圈。一个学生可以同时属于若干个不同的俱乐部。根据“我的朋友的朋友也是我的朋友”这个推论可以得出,如果A和B是朋友,且B和C是朋友,则A和C也是朋友。请... 阅读全文
posted @ 2018-12-13 16:45 black_hole6 阅读(310) 评论(0) 推荐(0)
摘要:time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou're given an array aa. You sho... 阅读全文
posted @ 2018-12-13 15:04 black_hole6 阅读(217) 评论(0) 推荐(0)
摘要:time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou're given an array aa. You sho... 阅读全文
posted @ 2018-12-13 15:04 black_hole6 阅读(203) 评论(0) 推荐(0)
摘要:题目描述一元nn次多项式可用如下的表达式表示:其中,a_ix^iai​xi称为ii次项,a_iai​ 称为ii次项的系数。给出一个一元多项式各项的次数和系数,请按照如下规定的格式要求输出该多项式: 多项式中自变量为xx,从左到右按照次数递减顺序给出多项式。 多项式... 阅读全文
posted @ 2018-12-13 12:26 black_hole6 阅读(286) 评论(0) 推荐(0)
摘要:题目描述一元nn次多项式可用如下的表达式表示:其中,a_ix^iai​xi称为ii次项,a_iai​ 称为ii次项的系数。给出一个一元多项式各项的次数和系数,请按照如下规定的格式要求输出该多项式: 多项式中自变量为xx,从左到右按照次数递减顺序给出多项式。 多项式... 阅读全文
posted @ 2018-12-13 12:26 black_hole6 阅读(126) 评论(0) 推荐(0)
摘要:time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Fair Nut lives in nn story ho... 阅读全文
posted @ 2018-12-12 23:47 black_hole6 阅读(266) 评论(0) 推荐(0)
摘要:time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Fair Nut lives in nn story ho... 阅读全文
posted @ 2018-12-12 23:47 black_hole6 阅读(234) 评论(0) 推荐(0)
摘要:Hooray! Berl II, the king of Berland is making a knight tournament. The king has already sent the message to all knights in the kingdo... 阅读全文
posted @ 2018-12-12 22:54 black_hole6 阅读(158) 评论(0) 推荐(0)
摘要:Hooray! Berl II, the king of Berland is making a knight tournament. The king has already sent the message to all knights in the kingdo... 阅读全文
posted @ 2018-12-12 22:54 black_hole6 阅读(159) 评论(0) 推荐(0)
摘要:There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical struct... 阅读全文
posted @ 2018-12-12 17:15 black_hole6 阅读(125) 评论(0) 推荐(0)
摘要:There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical struct... 阅读全文
posted @ 2018-12-12 17:15 black_hole6 阅读(129) 评论(0) 推荐(0)
摘要:The Chinese Zodiac, known as Sheng Xiao, is based on a twelve-year cycle, each year in the cycle related to an animal sign. These sign... 阅读全文
posted @ 2018-12-11 23:19 black_hole6 阅读(427) 评论(0) 推荐(0)
摘要:The Chinese Zodiac, known as Sheng Xiao, is based on a twelve-year cycle, each year in the cycle related to an animal sign. These sign... 阅读全文
posted @ 2018-12-11 23:19 black_hole6 阅读(351) 评论(0) 推荐(0)
摘要:It's graduated season, every students should leave something on the wall, so....they draw a lot of geometry shape with different color... 阅读全文
posted @ 2018-12-11 23:12 black_hole6 阅读(195) 评论(0) 推荐(0)
摘要:It's graduated season, every students should leave something on the wall, so....they draw a lot of geometry shape with different color... 阅读全文
posted @ 2018-12-11 23:12 black_hole6 阅读(195) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/315/B来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述妞妞听说Nowcod... 阅读全文
posted @ 2018-12-11 21:42 black_hole6 阅读(186) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/315/B来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述妞妞听说Nowcod... 阅读全文
posted @ 2018-12-11 21:42 black_hole6 阅读(177) 评论(0) 推荐(0)
摘要:Some dwarves that are finishing the StUDY (State University for Dwarven Youngsters) Bachelor courses, have been told "no genome, no de... 阅读全文
posted @ 2018-12-11 19:42 black_hole6 阅读(323) 评论(0) 推荐(0)
摘要:Some dwarves that are finishing the StUDY (State University for Dwarven Youngsters) Bachelor courses, have been told "no genome, no de... 阅读全文
posted @ 2018-12-11 19:42 black_hole6 阅读(282) 评论(0) 推荐(0)
摘要:题目描述给一n \times nn×n的字母方阵,内可能蕴含多个“yizhong”单词。单词在方阵中是沿着同一方向连续摆放的。摆放可沿着 88个方向的任一方向,同一单词摆放时不再改变方向,单词与单词之间可以交叉,因此有可能共用字母。输出时,将不是单词的字母用*代替,以... 阅读全文
posted @ 2018-12-11 10:39 black_hole6 阅读(195) 评论(0) 推荐(0)
摘要:题目描述给一n \times nn×n的字母方阵,内可能蕴含多个“yizhong”单词。单词在方阵中是沿着同一方向连续摆放的。摆放可沿着 88个方向的任一方向,同一单词摆放时不再改变方向,单词与单词之间可以交叉,因此有可能共用字母。输出时,将不是单词的字母用*代替,以... 阅读全文
posted @ 2018-12-11 10:39 black_hole6 阅读(447) 评论(0) 推荐(1)
摘要:一个分数一般写成两个整数相除的形式:N/M,其中 M 不为0。最简分数是指分子和分母没有公约数的分数表示形式。现给定两个不相等的正分数 N​1​​/M​1​​ 和 N​2​​/M​2​​,要求你按从小到大的顺序列出它们之间分母为 K 的最简分数。输入格式:输入在一行中... 阅读全文
posted @ 2018-12-11 09:02 black_hole6 阅读(509) 评论(0) 推荐(0)
摘要:一个分数一般写成两个整数相除的形式:N/M,其中 M 不为0。最简分数是指分子和分母没有公约数的分数表示形式。现给定两个不相等的正分数 N​1​​/M​1​​ 和 N​2​​/M​2​​,要求你按从小到大的顺序列出它们之间分母为 K 的最简分数。输入格式:输入在一行中... 阅读全文
posted @ 2018-12-11 09:02 black_hole6 阅读(158) 评论(0) 推荐(0)
摘要:A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and ... 阅读全文
posted @ 2018-12-10 21:56 black_hole6 阅读(241) 评论(0) 推荐(0)
摘要:A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and ... 阅读全文
posted @ 2018-12-10 21:56 black_hole6 阅读(145) 评论(0) 推荐(0)
摘要:"OK, you are not too bad, em... But you can never pass the next test." feng5166 says. "I will tell you an odd number N, and then N int... 阅读全文
posted @ 2018-12-10 19:16 black_hole6 阅读(136) 评论(0) 推荐(0)
摘要:"OK, you are not too bad, em... But you can never pass the next test." feng5166 says. "I will tell you an odd number N, and then N int... 阅读全文
posted @ 2018-12-10 19:16 black_hole6 阅读(341) 评论(0) 推荐(1)
摘要:A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may ... 阅读全文
posted @ 2018-12-10 09:43 black_hole6 阅读(119) 评论(0) 推荐(0)
摘要:A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may ... 阅读全文
posted @ 2018-12-10 09:43 black_hole6 阅读(91) 评论(0) 推荐(0)
摘要:上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B... 阅读全文
posted @ 2018-12-10 08:33 black_hole6 阅读(220) 评论(0) 推荐(0)
摘要:上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B... 阅读全文
posted @ 2018-12-10 08:33 black_hole6 阅读(154) 评论(0) 推荐(0)
摘要:省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。 Input测试输入包含若干测试... 阅读全文
posted @ 2018-12-09 23:30 black_hole6 阅读(139) 评论(0) 推荐(0)
摘要:省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。 Input测试输入包含若干测试... 阅读全文
posted @ 2018-12-09 23:30 black_hole6 阅读(125) 评论(0) 推荐(0)
摘要:I know, up on top you are seeing great sights,But down at the bottom, we, too, should have rights.We turtles can’t stand it. Our shell... 阅读全文
posted @ 2018-12-09 21:35 black_hole6 阅读(183) 评论(0) 推荐(0)
摘要:I know, up on top you are seeing great sights,But down at the bottom, we, too, should have rights.We turtles can’t stand it. Our shell... 阅读全文
posted @ 2018-12-09 21:35 black_hole6 阅读(149) 评论(0) 推荐(0)
摘要:FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean. Th... 阅读全文
posted @ 2018-12-09 21:29 black_hole6 阅读(106) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/316/E来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld题目描述当一个正整数能被... 阅读全文
posted @ 2018-12-08 23:19 black_hole6 阅读(187) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/316/B来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld题目描述Nozomi 是... 阅读全文
posted @ 2018-12-08 22:51 black_hole6 阅读(233) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/316/A来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld题目描述构造一个无重复的... 阅读全文
posted @ 2018-12-08 22:46 black_hole6 阅读(276) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/303/B来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述我们这样定义斐波... 阅读全文
posted @ 2018-12-08 22:39 black_hole6 阅读(185) 评论(0) 推荐(0)
摘要:Once upon a time, in the Kingdom of Loowater, a minor nuisance turned into a major problem.The shores of Rellau Creek in central Loowa... 阅读全文
posted @ 2018-12-08 13:14 black_hole6 阅读(116) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/308/B来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述tokitsuk... 阅读全文
posted @ 2018-12-07 23:43 black_hole6 阅读(245) 评论(0) 推荐(0)
摘要:Waiting for orders we held in the wood, word from the front never cameBy evening the sound of the gunfire was miles awayAh softly we m... 阅读全文
posted @ 2018-12-07 23:20 black_hole6 阅读(193) 评论(0) 推荐(0)
摘要:Codehorses has just hosted the second Codehorses Cup. This year, the same as the previous one, organizers are giving T-shirts for the ... 阅读全文
posted @ 2018-12-07 18:52 black_hole6 阅读(1136) 评论(0) 推荐(0)
摘要:小明对数的研究比较热爱,一谈到数,脑子里就涌现出好多数的问题,今天,小明想考考你对素数的认识。 问题是这样的:一个十进制数,如果是素数,而且它的各位数字和也是素数,则称之为“美素数”,如29,本身是素数,而且2+9 = 11也是素数,所以它是美素数。 给定一个... 阅读全文
posted @ 2018-12-06 23:41 black_hole6 阅读(237) 评论(0) 推荐(0)
摘要:作为杭电的老师,最盼望的日子就是每月的8号了,因为这一天是发工资的日子,养家糊口就靠它了,呵呵 但是对于学校财务处的工作人员来说,这一天则是很忙碌的一天,财务处的小胡老师最近就在考虑一个问题:如果每个老师的工资额都知道,最少需要准备多少张人民币,才能在给每位老师发工资... 阅读全文
posted @ 2018-12-06 16:48 black_hole6 阅读(428) 评论(0) 推荐(0)
摘要:A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7. Given A, B, and n, you are to... 阅读全文
posted @ 2018-12-06 16:30 black_hole6 阅读(171) 评论(0) 推荐(0)
摘要:今天终于发现了csdn可以操作的地方,有个自定义栏目的地方可以贴HTML代码(只允许最多一个自定义栏目),不能用JS插件有点难受,就贴了下自己的微信,并且可以直接点击图片发起会话以下是我的代码,可以将链接部分改成自己的:代码: 一个小白的WECHAT---------... 阅读全文
posted @ 2018-12-06 16:19 black_hole6 阅读(321) 评论(0) 推荐(0)
摘要:The three hands of the clock are rotating every second and meeting each other many times everyday. Finally, they get bored of this and... 阅读全文
posted @ 2018-12-06 15:44 black_hole6 阅读(196) 评论(0) 推荐(0)
摘要:The least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the numbers i... 阅读全文
posted @ 2018-12-06 14:48 black_hole6 阅读(143) 评论(0) 推荐(0)
摘要:Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action co... 阅读全文
posted @ 2018-12-06 10:31 black_hole6 阅读(177) 评论(0) 推荐(0)
摘要:I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. InputThe first line of th... 阅读全文
posted @ 2018-12-05 23:27 black_hole6 阅读(133) 评论(0) 推荐(0)
摘要:The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which... 阅读全文
posted @ 2018-12-05 17:26 black_hole6 阅读(138) 评论(0) 推荐(0)
摘要:某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹.... 阅读全文
posted @ 2018-12-05 16:58 black_hole6 阅读(387) 评论(0) 推荐(0)
摘要:时间限制 1000 ms 内存限制 32768 KB 代码长度限制 100 KB 判断程序 Standard (来自 小小)题目描述nowcoder费了很大劲,终于和地外文明联系上。我们地球人通常有10根手指,因此我们习惯用10进制的数,而外星人的手指有16跟、8根等... 阅读全文
posted @ 2018-12-05 16:23 black_hole6 阅读(562) 评论(0) 推荐(0)
摘要:爬取中国大学最好大学排名前二十代码:#CrawUnivRankingA.pyimport requestsfrom bs4 import BeautifulSoupimport bs4def getHTMLText(url): try: r=req... 阅读全文
posted @ 2018-12-04 23:45 black_hole6 阅读(160) 评论(0) 推荐(0)
摘要:A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supp... 阅读全文
posted @ 2018-12-04 22:27 black_hole6 阅读(165) 评论(0) 推荐(0)
摘要:ACboy has N courses this term, and he plans to spend at most M days on study.Of course,the profit he will gain from different course d... 阅读全文
posted @ 2018-12-04 19:51 black_hole6 阅读(299) 评论(0) 推荐(0)
摘要:Stack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). The basic operatio... 阅读全文
posted @ 2018-12-04 17:19 black_hole6 阅读(132) 评论(0) 推荐(0)
摘要:时间限制 1000 ms 内存限制 65536 KB 代码长度限制 100 KB 判断程序 Standard (来自 小小)题目描述If you are a fan of Harry Potter, you would know the world of magic ... 阅读全文
posted @ 2018-12-04 11:23 black_hole6 阅读(151) 评论(0) 推荐(0)
摘要:时间限制 1000 ms 内存限制 32768 KB 代码长度限制 100 KB 判断程序 Standard (来自 小小)题目描述计算机中采用浮点数表示所有实数,但这意味着精度丢失。例如无法精确表示“1/3”。NowCoder最近要处理很多金融问题,这些账目不允许出... 阅读全文
posted @ 2018-12-04 10:46 black_hole6 阅读(588) 评论(0) 推荐(0)
摘要:题目背景uim神犇拿到了uoi的ra(镭牌)后,立刻拉着基友小A到了一家……餐馆,很低端的那种。uim指着墙上的价目表(太低级了没有菜单),说:“随便点”。题目描述不过uim由于买了一些辅(e)辅(ro)书,口袋里只剩MM元(M \le 10000)(M≤10000)... 阅读全文
posted @ 2018-12-04 10:07 black_hole6 阅读(316) 评论(0) 推荐(0)
摘要:73 88 1 02 7 4 44 5 2 6 5(Figure 1)Figure 1 shows a number triangle. Write a program that calculates the highest s... 阅读全文
posted @ 2018-12-04 09:07 black_hole6 阅读(244) 评论(0) 推荐(0)
摘要:时间限制 1000 ms 内存限制 32768 KB 代码长度限制 100 KB 判断程序 Standard (来自 小小)题目描述给定三条边,请你判断一下能不能组成一个三角形。 输入描述:输入包含多组数据,每组数据包含三个正整数a、b、c(1≤a, b, c≤10^... 阅读全文
posted @ 2018-12-03 23:26 black_hole6 阅读(251) 评论(0) 推荐(0)
摘要:穿过幽谷意味着离大魔王lemon已经无限接近了! 可谁能想到,yifenfei在斩杀了一些虾兵蟹将后,却再次面临命运大迷宫的考验,这是魔王lemon设下的又一个机关。要知道,不论何人,若在迷宫中被困1小时以上,则必死无疑! 可怜的yifenfei为了去救MM,义无返顾... 阅读全文
posted @ 2018-12-03 23:04 black_hole6 阅读(180) 评论(0) 推荐(0)
摘要:题目描述金明今天很开心,家里购置的新房就要领钥匙了,新房里有一间他自己专用的很宽敞的房间。更让他高兴的是,妈妈昨天对他说:“你的房间需要购买哪些物品,怎么布置,你说了算,只要不超过NN元钱就行”。今天一早金明就开始做预算,但是他想买的东西太多了,肯定会超过妈妈限定的N... 阅读全文
posted @ 2018-12-03 09:36 black_hole6 阅读(258) 评论(0) 推荐(0)
摘要:时间限制 1000 ms 内存限制 32768 KB 代码长度限制 100 KB 判断程序 Standard (来自 小小)题目描述星际战争开展了100年之后,NowCoder终于破译了外星人的密码!他们的密码是一串整数,通过一张表里的信息映射成最终4位密码。表的规则... 阅读全文
posted @ 2018-12-02 21:03 black_hole6 阅读(336) 评论(0) 推荐(0)
摘要:时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述 小乐乐觉得学习太简单了,剩下那么多的时间好无聊,于是便想打游戏。 最近新出了一个特别火的游戏... 阅读全文
posted @ 2018-12-02 20:46 black_hole6 阅读(234) 评论(0) 推荐(0)
摘要:时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述 小乐乐是一个比较喜欢吃糖豆的小孩子,小乐乐的哥哥大乐乐也同样爱吃糖豆。作为一个小孩子,他们永远觉得谁吃掉了最后一个... 阅读全文
posted @ 2018-12-02 20:43 black_hole6 阅读(184) 评论(0) 推荐(0)
摘要:都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都... 阅读全文
posted @ 2018-12-02 17:31 black_hole6 阅读(1147) 评论(0) 推荐(0)
摘要:农夫要修理牧场的一段栅栏,他测量了栅栏,发现需要N块木头,每块木头长度为整数L​i​​个长度单位,于是他购买了一条很长的、能锯成N块的木头,即该木头的长度是L​i​​的总和。但是农夫自己没有锯子,请人锯木的酬金跟这段木头的长度成正比。为简单起见,不妨就设酬金等于所锯... 阅读全文
posted @ 2018-12-02 16:40 black_hole6 阅读(540) 评论(0) 推荐(0)
摘要:电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。 某天,食堂中有n种菜出售,每种菜可购买... 阅读全文
posted @ 2018-12-02 16:09 black_hole6 阅读(262) 评论(0) 推荐(1)
摘要:A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another seq... 阅读全文
posted @ 2018-12-02 00:17 black_hole6 阅读(123) 评论(0) 推荐(0)