04 2019 档案

摘要:1、动态规划(DP) 动态规划(Dynamic Programming,DP)与分治区别在于划分的子问题是有重叠的,解过程中对于重叠的部分只要求解一次,记录下结果,其他子问题直接使用即可,减少了重复计算过程。 另外,DP在求解一个问题最优解的时候,不是固定的计算合并某些子问题的解,而是根据各子问题的 阅读全文
posted @ 2019-04-30 22:59 black_hole6 阅读(295) 评论(0) 推荐(0) 编辑
摘要:二维几何部分 三维几何部分 代码: 平面最近点对 代码: 三维凸包 代码: 阅读全文
posted @ 2019-04-30 17:51 black_hole6 阅读(698) 评论(0) 推荐(0) 编辑
摘要:A. Stock Arbitraging 直接上代码: B. Tiling Challenge 找一下就行了 代码: C. Prefix Sum Primes 思维+构造也很好想 代码; 阅读全文
posted @ 2019-04-30 12:14 black_hole6 阅读(190) 评论(0) 推荐(0) 编辑
摘要:A. Reachable Numbers 题意:设f(x)为 x+1 这个数去掉后缀0的数,现在给出n,问经过无数次这种变换后,最多能得到多少个不同的数。 代码 #include<cstdio> #include<cstring> #include<iostream> #include<algori 阅读全文
posted @ 2019-04-29 22:21 black_hole6 阅读(204) 评论(0) 推荐(0) 编辑
摘要:题目:阶乘位数9的阶乘等于:362880 它的二进制表示为:1011000100110000000 这个数字共有19位。请你计算,9999 的阶乘的二进制表示一共有多少位? 注意:需要提交的是一个整数,不要填写任何无关内容(比如说明解释等)思路:把每一个数都用2的x的... 阅读全文
posted @ 2019-04-26 23:07 black_hole6 阅读(327) 评论(0) 推荐(0) 编辑
摘要:DescriptionFarmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farm... 阅读全文
posted @ 2019-04-26 17:12 black_hole6 阅读(126) 评论(0) 推荐(0) 编辑
摘要:年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他... 阅读全文
posted @ 2019-04-26 09:40 black_hole6 阅读(176) 评论(0) 推荐(0) 编辑
摘要:链接:https://ac.nowcoder.com/acm/contest/213/A来源:牛客网 题目描述一场考试怎么能没有大模拟呢qwq,SKY_magician听说过猪国杀、德州扑克、UNO、杀蚂蚁等等,但是他觉得这些模拟写起来太短了,于是他就设计了一个肯定不... 阅读全文
posted @ 2019-04-24 20:24 black_hole6 阅读(268) 评论(0) 推荐(0) 编辑
摘要:链接:https://ac.nowcoder.com/acm/contest/372/B来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述某天,一只可爱的... 阅读全文
posted @ 2019-04-24 19:53 black_hole6 阅读(169) 评论(0) 推荐(0) 编辑
摘要:链接:https://ac.nowcoder.com/acm/contest/543/C来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述有一只可爱的兔子被困... 阅读全文
posted @ 2019-04-24 19:52 black_hole6 阅读(303) 评论(0) 推荐(0) 编辑
摘要:Andrewid the Android is a galaxy-famous detective. He is now investigating the case of vandalism at the exhibition of contemporary art... 阅读全文
posted @ 2019-04-24 14:56 black_hole6 阅读(198) 评论(0) 推荐(0) 编辑
摘要:题目描述X星球的机器人表演拉拉队有两种服装,A和B。他们这次表演的是搭机器人塔。类似: A B B A B A A A B B B B B A BA B A B B A队内的组塔规则是: A 只能站在 AA 或 BB 的肩上。 B 只能站在... 阅读全文
posted @ 2019-04-23 23:40 black_hole6 阅读(318) 评论(0) 推荐(0) 编辑
摘要:题目描述小明冒充X星球的骑士,进入了一个奇怪的城堡。城堡里边什么都没有,只有方形石头铺成的地面。假设城堡地面是 n x n 个方格。【如图1.png】所示。按习俗,骑士要从西北角走到东南角。可以横向或纵向移动,但不能斜着走,也不能跳跃。每走到一个新方格,就要向正北方和... 阅读全文
posted @ 2019-04-23 11:38 black_hole6 阅读(415) 评论(0) 推荐(0) 编辑
摘要:都说了别看,还看!好吧,既然点进来了,那就告诉你题意:给你一个方程,Ax+By+C=0,给你A,B,C;请找出一组解(x,y),解的要求:x是所有解中的最小正整数,y就是任意一个整数。如果存在这样的解,请给出这个解中的x;如果不存在,请输出 -1。会吗?Input ... 阅读全文
posted @ 2019-04-22 00:15 black_hole6 阅读(275) 评论(0) 推荐(0) 编辑
摘要:Input2Output2 Hint1. For N = 2, S(1) = S(2) = 1. 2. The input file consists of multiple test cases.Sample Input2Sample Output2... 阅读全文
posted @ 2019-04-20 20:34 black_hole6 阅读(306) 评论(0) 推荐(0) 编辑
摘要:A为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(A^k)%9973。 Input数据的第一行是一个T,表示有T组数据。 每组数据的第一行有n(2 #include#include#include#include#include#include... 阅读全文
posted @ 2019-04-15 09:19 black_hole6 阅读(588) 评论(0) 推荐(0) 编辑
摘要:Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popular coach for his success. He needs some... 阅读全文
posted @ 2019-04-13 18:23 black_hole6 阅读(194) 评论(0) 推荐(0) 编辑
摘要:In our daily life we often use 233 to express our feelings. Actually, we may say 2333, 23333, or 233333 ... in the same meaning. And h... 阅读全文
posted @ 2019-04-13 12:01 black_hole6 阅读(343) 评论(1) 推荐(0) 编辑
摘要:Edward, the emperor of the Marjar Empire, wants to build some bidirectional highways so that he can reach other cities from the capita... 阅读全文
posted @ 2019-04-12 16:52 black_hole6 阅读(206) 评论(0) 推荐(0) 编辑
摘要:Edward, the headmaster of the Marjar University, is very busy every day and always forgets the date.There was one day Edward suddenly ... 阅读全文
posted @ 2019-04-11 23:37 black_hole6 阅读(220) 评论(0) 推荐(0) 编辑
摘要:It’s time to fight the local despots and redistribute the land. There is a rectangular piece of land granted from the government, whos... 阅读全文
posted @ 2019-04-11 17:06 black_hole6 阅读(171) 评论(0) 推荐(0) 编辑
摘要:A + B Problem II 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... 阅读全文
posted @ 2019-04-11 16:53 black_hole6 阅读(589) 评论(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 @ 2019-04-11 09:45 black_hole6 阅读(142) 评论(0) 推荐(0) 编辑
摘要:Bob's school has a big playground, boys and girls always play games here after school. To protect boys and girls from getting hurt whe... 阅读全文
posted @ 2019-04-10 22:24 black_hole6 阅读(202) 评论(0) 推荐(0) 编辑
摘要:原博客:https://blog.csdn.net/wookaikaiko/article/details/81105031一、关于卡特兰数 卡特兰数是一种经典的组合数,经常出现在各种计算中,其前几项为 : 1, 2, 5, 14, 42, 132, 42... 阅读全文
posted @ 2019-04-10 18:54 black_hole6 阅读(790) 评论(0) 推荐(0) 编辑
摘要:In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several cons... 阅读全文
posted @ 2019-04-09 16:23 black_hole6 阅读(118) 评论(0) 推荐(0) 编辑
摘要:You have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to add some given numbe... 阅读全文
posted @ 2019-04-09 16:04 black_hole6 阅读(181) 评论(0) 推荐(0) 编辑
摘要:很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文... 阅读全文
posted @ 2019-04-09 11:44 black_hole6 阅读(123) 评论(0) 推荐(0) 编辑
摘要:C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚... 阅读全文
posted @ 2019-04-08 23:43 black_hole6 阅读(158) 评论(0) 推荐(0) 编辑
摘要:The name of one small but proud corporation consists of n lowercase English letters. The Corporation has decided to try rebranding — a... 阅读全文
posted @ 2019-04-08 17:28 black_hole6 阅读(216) 评论(0) 推荐(0) 编辑
摘要:标题:拼接平方数 小明发现49很有趣,首先,它是个平方数。它可以拆分为4和9,拆分出来的部分也是平方数。169也有这个性质,我们权且称它们为:拼接平方数。 100可拆分1 00,这有点勉强,我们规定,0 00 000 等都不算平方数。 小明想:还有哪... 阅读全文
posted @ 2019-04-08 15:36 black_hole6 阅读(248) 评论(0) 推荐(0) 编辑
摘要:标题:格子刷油漆 X国的一段古城墙的顶端可以看成 2*N个格子组成的矩形(如图1所示),现需要把这些格子刷上保护漆。 你可以从任意一个格子刷起,刷完一格,可以移动到和它相邻的格子(对角相邻也算数),但不能移动到较远的格子(因为油漆未干不能踩!) 比如... 阅读全文
posted @ 2019-04-08 09:35 black_hole6 阅读(190) 评论(0) 推荐(0) 编辑
摘要:标题:高僧斗法 古时丧葬活动中经常请高僧做法事。仪式结束后,有时会有“高僧斗法”的趣味节目,以舒缓压抑的气氛。 节目大略步骤为:先用粮食(一般是稻米)在地上“画”出若干级台阶(表示N级浮屠)。又有若干小和尚随机地“站”在某个台阶上。最高一级台阶必须站人,其... 阅读全文
posted @ 2019-04-08 09:31 black_hole6 阅读(189) 评论(0) 推荐(0) 编辑
摘要:标题:网络寻路 X 国的一个网络使用若干条线路连接若干个节点。节点间的通信是双向的。某重要数据包,为了安全起见,必须恰好被转发两次到达目的地。该包可能在任意一个节点产生,我们需要知道该网络中一共有多少种不同的转发路径。 源地址和目标地址可以相同,但中间节点... 阅读全文
posted @ 2019-04-08 09:26 black_hole6 阅读(261) 评论(0) 推荐(0) 编辑
摘要:标题:危险系数 抗日战争时期,冀中平原的地道战曾发挥重要作用。 地道的多个站点间有通道连接,形成了庞大的网络。但也有隐患,当敌人发现了某个站点后,其它站点间可能因此会失去联系。 我们来定义一个危险系数DF(x,y): 对于两个站点x和y (... 阅读全文
posted @ 2019-04-08 09:23 black_hole6 阅读(173) 评论(0) 推荐(0) 编辑
摘要:Given a m-by-n (0,1)-matrix, of all its submatrices of all 1’s which is the largest? By largest we mean that the submatrix has the mos... 阅读全文
posted @ 2019-04-07 22:48 black_hole6 阅读(184) 评论(0) 推荐(0) 编辑
摘要:Signals of most probably extra-terrestrial origin have been received and digitalized by The Aeronautic and Space Administration (that ... 阅读全文
posted @ 2019-04-07 11:20 black_hole6 阅读(345) 评论(0) 推荐(0) 编辑
摘要:有n种物品,并且知道每种物品的数量。要求从中选出m件物品的排列数。例如有两种物品A,B,并且数量都是1,从中选2件物品,则排列有"AB","BA"两种。 Input每组输入数据有两行,第一行是二个数n,m(1#include#include#include#inclu... 阅读全文
posted @ 2019-04-04 11:01 black_hole6 阅读(270) 评论(0) 推荐(0) 编辑
摘要:度度熊喜欢着喵哈哈村的大明星——星星小姐。 为什么度度熊会喜欢星星小姐呢? 首先星星小姐笑起来非常动人,其次星星小姐唱歌也非常好听。 但这都不是最重要的,最重要的是,星星小姐拍的一手好代码! 于是度度熊关注了星星小姐的贴吧。 一开始度度熊决定每天都在星星小姐的贴吧里面... 阅读全文
posted @ 2019-04-03 15:01 black_hole6 阅读(192) 评论(0) 推荐(0) 编辑

欢迎阅读『2019 年 4月 随笔档案』