YunYan

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

08 2019 档案

摘要:l例题连接:https://www.luogu.org/problem/P1908 猫猫TOM和小老鼠JERRY最近又较量上了,但是毕竟都是成年人,他们已经不喜欢再玩那种你追我赶的游戏,现在他们喜欢玩统计。最近,TOM老猫查阅到一个人类称之为“逆序对”的东西,这东西是这样定义的:对于给定的一段正整数 阅读全文
posted @ 2019-08-25 11:10 Target--fly 阅读(307) 评论(0) 推荐(0)

摘要:https://www.cnblogs.com/vectors07/p/8053427.html 即 一个n边形(n>=3) 沿着顶点切割,分割成三角形,最多有多少种方案 阅读全文
posted @ 2019-08-25 09:04 Target--fly 阅读(359) 评论(0) 推荐(0)

摘要:C 小石的海岛之旅 链接:https://ac.nowcoder.com/acm/contest/949/C来源:牛客网 暑假到了,小石和小雨到海岛上玩。 从水平方向看海岛可以看成 nnn个小块,每一个小块都有一个高度hih_ihi​, 水位一开始为 000,随着水位的上升,海岛分成了若干块。 现在 阅读全文
posted @ 2019-08-24 10:27 Target--fly 阅读(188) 评论(0) 推荐(0)

摘要:dp[n][m]指从n个数中挑选m个 还可以直接根据定义计算 阅读全文
posted @ 2019-08-23 13:03 Target--fly 阅读(179) 评论(0) 推荐(0)

摘要:D. Tom的战力问题 Tom被斯派克揍了TAT。Tom下定决心要战胜斯派克。但是在战胜最强的斯派克之前,Tom要先打败其他的狗。为此,他打算先收集一下信息。现在Tom在了得到了一些关于战斗力的小道消息,例如X号狗狗的战力比Y号狗狗的战力高S点。Tom想知道利用这些消息,能不能判断出某两只狗之间的战 阅读全文
posted @ 2019-08-22 20:47 Target--fly 阅读(271) 评论(0) 推荐(0)

摘要:模板一: Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by water for 阅读全文
posted @ 2019-08-19 16:41 Target--fly 阅读(147) 评论(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 the input contains 阅读全文
posted @ 2019-08-19 15:46 Target--fly 阅读(231) 评论(0) 推荐(0)

摘要:steve 学完了快速幂,现在会他快速的计算:(ij)%d , Alex 作为一个数学大师,给了 steve 一个问题:已知i∈[1,n],j∈[1,m] ,计算满足 (ij)%d=0 的 (i,j) 的对数。 steve 学完了快速幂,现在会他快速的计算:(ij)%d , Alex 作为一个数学大 阅读全文
posted @ 2019-08-18 23:11 Target--fly 阅读(145) 评论(0) 推荐(0)

摘要:B. 掷骰子 单点时限: 2.0 sec 内存限制: 512 MB 单点时限: 2.0 sec 内存限制: 512 MB 单点时限: 2.0 sec 内存限制: 512 MB 骰子,中国传统民间娱乐用来投掷的博具,早在战国时期就已经被发明。 现在给你 n 个骰子,求 n 个骰子掷出点数之和为 a 的 阅读全文
posted @ 2019-08-18 22:58 Target--fly 阅读(232) 评论(0) 推荐(0)

摘要:Input第一行输入三个整数n,k,m(2<=k<=n<=100000,1<=m<=100000)。 第二行包含n个整数a1,a2,..., an(0 <= ai <= 10^9 )。Output如果不存在这样的k个数,输出"No";否则输出"Yes"后,在下一行输出这k个数,数与数之间用空格隔开。 阅读全文
posted @ 2019-08-18 18:49 Target--fly 阅读(159) 评论(0) 推荐(0)

摘要:邓布利多教授正在帮助哈利摧毁魂器。当他怀疑一个魂器出现在那里时,他去了冈特沙克。他看到Marvolo Gaunt的戒指,并将其确定为魂器。虽然他摧毁了它,但仍然受到诅咒的影响。斯内普教授正在帮助邓布利多解除诅咒。为此,他想给Dumbledore提供他制作的药水x滴。 x的值被计算为给定p,q,r和阵 阅读全文
posted @ 2019-08-18 18:44 Target--fly 阅读(202) 评论(0) 推荐(0)

摘要:点完菜,他们发现好像觉得少了点什么? 想想马上就要回老家了某不愿透露姓名的林姓学长再次却陷入了沉思。。。。。。。。。 他默默的去前台打算点几瓶二锅头。 他发现菜单上有n 种不同毫升的酒. 第 i 种有2i - 1 毫升价格为ci 元.商店中每种类型的酒的数量可以被认为是无限的。. 他对于自己能喝多少 阅读全文
posted @ 2019-08-18 18:05 Target--fly 阅读(339) 评论(0) 推荐(0)

摘要:给你一个长度为 n 的数字串,找出其中位数不超过15位的不包含前导0和后导0的数 x ,使得 x+f(x) 是一个回文数,其中 f(x) 表示将 x 反转过来的数。 给你一个长度为 n 的数字串,找出其中位数不超过15位的不包含前导0和后导0的数 x ,使得 x+f(x) 是一个回文数,其中 f(x 阅读全文
posted @ 2019-08-17 22:39 Target--fly 阅读(157) 评论(0) 推荐(0)

摘要:算术基本定理:又称为正整数的唯一分解定理,即:每个大于1的自然数均可写为质数的积,而且这些素因子按大小排列之后,写法仅有一种方式。 1 公式表示法:N=a1^p1*a2^p2.....(ai是素因子,pi是素因子ai出现的次数) 分解复杂度O(sqrt(n)) 2 一个数因子的个数 ans=(1+p 阅读全文
posted @ 2019-08-16 22:34 Target--fly 阅读(508) 评论(0) 推荐(0)

摘要:CC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are only 99.9 yuan le 阅读全文
posted @ 2019-08-16 20:50 Target--fly 阅读(187) 评论(0) 推荐(0)

摘要:For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the pr 阅读全文
posted @ 2019-08-16 20:44 Target--fly 阅读(222) 评论(0) 推荐(0)

摘要:一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。 阅读全文
posted @ 2019-08-16 20:27 Target--fly 阅读(294) 评论(0) 推荐(0)

摘要:Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a 阅读全文
posted @ 2019-08-16 20:23 Target--fly 阅读(487) 评论(0) 推荐(0)

摘要:LCM (Least Common Multiple) of a set of integers is defined as the minimum number, which is a multiple of all integers of that set. It is interesting 阅读全文
posted @ 2019-08-15 22:38 Target--fly 阅读(162) 评论(0) 推荐(0)

摘要:在给定的一个整数序列中,小L希望找到一个连续的区间,这个区间的和能够被k整除,请你帮小L算一下满足条件的最长的区间长度是多少。 在给定的一个整数序列中,小L希望找到一个连续的区间,这个区间的和能够被k整除,请你帮小L算一下满足条件的最长的区间长度是多少。 输入 第一行输入两个整数n、k。(1 <= 阅读全文
posted @ 2019-08-15 21:06 Target--fly 阅读(176) 评论(0) 推荐(0)

摘要:小学时期的小L发现自己很有艺术细胞,于是买了一块画板,但是他的绘画水平使得他只能连接两点画出一条线段。有一天他决定在一张有n个点的图上作画,即他可以把这n个点任意连接。大家认为平行线是非常不美观的,于是他想知道自己最多能画多少条直线使整张画不出现平行线。 小学时期的小L发现自己很有艺术细胞,于是买了 阅读全文
posted @ 2019-08-15 21:01 Target--fly 阅读(167) 评论(0) 推荐(0)

摘要:Given a number N, you are asked to count the number of integers between A and B inclusive which are relatively prime to N. Two integers are said to be 阅读全文
posted @ 2019-08-15 20:45 Target--fly 阅读(132) 评论(0) 推荐(0)

摘要:Z城市居住着很多只跳蚤。在Z城市周六生活频道有一个娱乐节目。一只跳蚤将被请上一个高空钢丝的正中央。钢丝很长,可以看作是无限长。节目主持人会给该跳蚤发一张卡片。卡片上写有N+1个自然数。其中最后一个是M,而前N个数都不超过M,卡片上允许有相同的数字。跳蚤每次可以从卡片上任意选择一个自然数S,然后向左, 阅读全文
posted @ 2019-08-15 20:38 Target--fly 阅读(185) 评论(0) 推荐(0)

摘要:Now you get a number N, and a M-integers set, you should find out how many integers which are small than N, that they can divided exactly by any integ 阅读全文
posted @ 2019-08-15 15:17 Target--fly 阅读(133) 评论(0) 推荐(0)

摘要:Kids like candies, so much that they start beating each other if the candies are not fairly distributed. So on your next party, you better start think 阅读全文
posted @ 2019-08-14 23:16 Target--fly 阅读(267) 评论(0) 推荐(0)

摘要:The Sky is Sprite. The Birds is Fly in the Sky. The Wind is Wonderful. Blew Throw the Trees Trees are Shaking, Leaves are Falling. Lovers Walk passing 阅读全文
posted @ 2019-08-14 23:13 Target--fly 阅读(186) 评论(0) 推荐(0)

摘要:Given two integers, a and b, you should check whether a is divisible by b or not. We know that an integer a is divisible by an integer b if and only i 阅读全文
posted @ 2019-08-14 22:59 Target--fly 阅读(191) 评论(0) 推荐(0)

摘要:两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对 阅读全文
posted @ 2019-08-14 22:49 Target--fly 阅读(216) 评论(0) 推荐(0)

摘要:对于 ax+by=gcd(a,b) 这样的方程,可以用扩展欧几里得算法exgcd求出一组通解。 根据欧几里得求gcd: gcd(a,b)=gcd(b,a%b) 可得 bx+(a%b)y=gcd(b,a%b) 根据 a%b=a−(a/b)∗b 可得 bx+ay−(a/b)b∗y=gcd(b,a%b) 阅读全文
posted @ 2019-08-14 14:07 Target--fly 阅读(314) 评论(0) 推荐(0)

摘要:题目描述 小L期末考试结束,高高兴兴放假回家了,可是那么多试卷,老师还要加班批改,有n份试卷由k个老师批改,n份试卷进行了密封编号,由于试卷上的做题情况和书写的规范程序不一样,批改不同的试卷用时也可能不一样,每个老师批改试卷的编号顺序是连续的,每位老师批改完分配给自己的试卷就可以离开,问最后离开的老 阅读全文
posted @ 2019-08-13 21:08 Target--fly 阅读(138) 评论(0) 推荐(0)

摘要:题目描述 在给定的一个整数序列中,小L希望找到一个连续的区间,这个区间的和能够被k整除,请你帮小L算一下满足条件的最长的区间长度是多少。 题目描述 在给定的一个整数序列中,小L希望找到一个连续的区间,这个区间的和能够被k整除,请你帮小L算一下满足条件的最长的区间长度是多少。 输入 第一行输入两个整数 阅读全文
posted @ 2019-08-13 20:21 Target--fly 阅读(276) 评论(0) 推荐(0)

摘要:Given two positive integers G and L, could you tell me how many solutions of (x, y, z) there are, satisfying that gcd(x, y, z) = G and lcm(x, y, z) = 阅读全文
posted @ 2019-08-13 08:18 Target--fly 阅读(128) 评论(0) 推荐(0)

摘要:It's said that Aladdin had to solve seven mysteries before getting the Magical Lamp which summons a powerful Genie. Here we are concerned about the fi 阅读全文
posted @ 2019-08-12 23:18 Target--fly 阅读(113) 评论(0) 推荐(0)

摘要:Ekka and his friend Dokka decided to buy a cake. They both love cakes and that's why they want to share the cake after buying it. As the name suggeste 阅读全文
posted @ 2019-08-12 23:13 Target--fly 阅读(210) 评论(0) 推荐(0)

摘要:Find the result of the following code: long long pairsFormLCM( int n ) { long long res = 0; for( int i = 1; i <= n; i++ ) for( int j = i; j <= n; j++  阅读全文
posted @ 2019-08-12 23:05 Target--fly 阅读(125) 评论(0) 推荐(0)

摘要:While skimming his phone directory in 1982, Albert Wilansky, a mathematician of Lehigh University,noticed that the telephone number of his brother-in- 阅读全文
posted @ 2019-08-12 22:47 Target--fly 阅读(178) 评论(0) 推荐(0)

摘要:已知每块石头中的规格是1×1×1,水塘的长度为N,宽度为1,在第i位置,大树放了ai个石头 设大树建造的水塘蓄水量为V 请你求出在长度和宽度不变的情况下,建造一个蓄水量不小于V的水塘最多可以节约多少石头 已知每块石头中的规格是1×1×1,水塘的长度为N,宽度为1,在第i位置,大树放了ai个石头 设大 阅读全文
posted @ 2019-08-11 16:33 Target--fly 阅读(128) 评论(0) 推荐(0)

摘要:幸运数是经由类似埃拉托斯特尼筛法的演算法后留下的整数集合,是在1955年波兰数学家乌拉姆提出。 由一组由1开始的数列为例: 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25, …先将所有偶数删去,只留下 阅读全文
posted @ 2019-08-11 16:28 Target--fly 阅读(764) 评论(0) 推荐(0)

摘要:板子: code:(如果编译器为c++11以上的,不要这样 que.push({dx,dis[dx]}) ) struct stu{ int a,b; bool friend operator<(const stu &x,const stu &y){ return x.b>y.b; } }; voi 阅读全文
posted @ 2019-08-11 14:36 Target--fly 阅读(263) 评论(0) 推荐(0)

摘要:迪杰斯特拉记录路径的办法就是开一个数组, 记录一下该节点的上一个节点是谁最后在递归输出就可以了 例题: B. wzy的大冒险——出发咯QAQ 单点时限: 2.0 sec 内存限制: 512 MB 单点时限: 2.0 sec 内存限制: 512 MB 单点时限: 2.0 sec 内存限制: 512 M 阅读全文
posted @ 2019-08-11 14:12 Target--fly 阅读(913) 评论(0) 推荐(0)

摘要:Farmer John wants the cows to prepare for the county jumping competition, so Bessie and the gang are practicing jumping over hurdles. They are getting 阅读全文
posted @ 2019-08-09 18:46 Target--fly 阅读(152) 评论(0) 推荐(0)

摘要:Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but 阅读全文
posted @ 2019-08-09 08:05 Target--fly 阅读(217) 评论(0) 推荐(0)

摘要:直接上例题: HDU2544 在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗? Input输入包括多组数据。每组数据第一行是两个整数N、M( 阅读全文
posted @ 2019-08-08 22:52 Target--fly 阅读(146) 评论(0) 推荐(0)

摘要:A rooted tree is a well-known data structure in computer science and engineering. An example is shown below: In the figure, each node is labeled with 阅读全文
posted @ 2019-08-08 19:29 Target--fly 阅读(211) 评论(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 is it if I want 阅读全文
posted @ 2019-08-08 19:27 Target--fly 阅读(127) 评论(0) 推荐(0)

摘要:Language: Default Closest Common Ancestors Time Limit: 2000MS Memory Limit: 10000K Total Submissions: 24653 Accepted: 7648 Description Write a program 阅读全文
posted @ 2019-08-08 17:39 Target--fly 阅读(120) 评论(0) 推荐(0)

摘要:例题:http://poj.org/problem?id=1986 POJ1986 Distance Queries Language: Default Distance Queries Time Limit: 2000MS Memory Limit: 30000K Total Submission 阅读全文
posted @ 2019-08-08 16:49 Target--fly 阅读(302) 评论(0) 推荐(0)

摘要:https://www.luogu.org/problemnew/solution/P3379 LCA叫做最短公共祖先,用来求距离树上两个节点最近的公共点; 常用倍增算法: 阅读全文
posted @ 2019-08-08 16:46 Target--fly 阅读(307) 评论(0) 推荐(0)

摘要:自从Lele开发了Rating系统,他的Tetris事业更是如虎添翼,不久他遍把这个游戏推向了全球。为了更好的符合那些爱好者的喜好,Lele又想了一个新点子:他将制作一个全球Tetris高手排行榜,定时更新,名堂要比福布斯富豪榜还响。关于如何排名,这个不用说都知道是根据Rating从高到低来排,如果 阅读全文
posted @ 2019-08-07 22:56 Target--fly 阅读(190) 评论(0) 推荐(0)

摘要:有一群人,打乒乓球比赛,两两捉对撕杀,每两个人之间最多打一场比赛。 球赛的规则如下: 如果A打败了B,B又打败了C,而A与C之间没有进行过比赛,那么就认定,A一定能打败C。 如果A打败了B,B又打败了C,而且,C又打败了A,那么A、B、C三者都不可能成为冠军。 根据这个规则,无需循环较量,或许就能确 阅读全文
posted @ 2019-08-07 18:49 Target--fly 阅读(278) 评论(0) 推荐(0)

摘要:Boudreaux likes to multitask, especially when it comes to using his computer. Never satisfied with just running one application at a time, he usually 阅读全文
posted @ 2019-08-07 17:27 Target--fly 阅读(177) 评论(0) 推荐(0)

摘要:https://www.cnblogs.com/1242118789lr/p/6740930.html 可以用邻接表也可以用邻接矩阵 当数据量级很大的时候我们选择邻接表,数据量小的时候可以选择邻接表也可以选择邻接矩阵 如UVA10305 John has n tasks to do. Unfortu 阅读全文
posted @ 2019-08-07 13:10 Target--fly 阅读(270) 评论(0) 推荐(0)

摘要:Problem Description Dandelion's uncle is a boss of a factory. As the spring festival is coming , he wants to distribute rewards to his workers. Now he 阅读全文
posted @ 2019-08-07 12:02 Target--fly 阅读(180) 评论(0) 推荐(0)

摘要:Advanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are used for vegetable delivery, other for furniture, or for bricks. The com 阅读全文
posted @ 2019-08-06 19:45 Target--fly 阅读(122) 评论(0) 推荐(0)

摘要:链接:https://ac.nowcoder.com/acm/contest/699/B?&headNav=acm&headNav=acm来源:牛客网 题目描述 在某华大学里有一个无聊的群组,群内的所有成员都是复读机,他们疯狂复读着别人的消息。然而复读机们在群内也是有阵营的,一个阵营的复读机会根据心 阅读全文
posted @ 2019-08-06 18:42 Target--fly 阅读(191) 评论(0) 推荐(0)

摘要:The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has a very poor system of public highways. The Flatopian government is aware 阅读全文
posted @ 2019-08-06 18:04 Target--fly 阅读(208) 评论(0) 推荐(0)

摘要:Five hundred years later, the number of dragon balls will increase unexpectedly, so it's too difficult for Monkey King(WuKong) to gather all of the dr 阅读全文
posted @ 2019-08-05 23:32 Target--fly 阅读(146) 评论(0) 推荐(0)

摘要:Farmer John and Betsy are playing a game with N (1 <= N <= 30,000)identical cubes labeled 1 through N. They start with N stacks, each containing a sin 阅读全文
posted @ 2019-08-05 23:27 Target--fly 阅读(114) 评论(0) 推荐(0)

摘要:主要函数: 路径压缩之递归优化:(使用递归优化可以遍历到每一个节点,在进行回溯的时候我们可以对子节点与父节点的关系进行处理,在解决带权并查集时常用到) 但是当数据量过大时,就不能用了,会MLE错误 路径压缩非递归 阅读全文
posted @ 2019-08-05 23:03 Target--fly 阅读(136) 评论(0) 推荐(0)

摘要:单点时限: 1.0 sec 内存限制: 512 MB 单点时限: 1.0 sec 内存限制: 512 MB 单点时限: 1.0 sec 内存限制: 512 MB 聪明的小蚂蚁最近学习了斐波那契数列,但是它想到了一个问题:从L到R之间斐波那契数列和的奇偶是什么呢?其中Fib[1]=1,Fib[2]=1 阅读全文
posted @ 2019-08-04 10:37 Target--fly 阅读(251) 评论(0) 推荐(0)

摘要:蚂蚁上树(Sauteed Vermicelli with minced Pork),又名肉末粉条,是四川省及重庆市的特色传统名菜之一。因肉末贴在粉丝上,形似蚂蚁爬在树枝上而得名。这道菜具体的历史,已不可考。但在四川省、重庆市一带,该菜很常见。 蚂蚁上树通常由粉丝(或者粉条)、肉末为主料,辅以胡萝卜、 阅读全文
posted @ 2019-08-04 09:47 Target--fly 阅读(200) 评论(0) 推荐(0)

摘要:单点时限: 1.0 sec 内存限制: 512 MB 单点时限: 1.0 sec 内存限制: 512 MB 单点时限: 1.0 sec 内存限制: 512 MB 一只聪明的蚂蚁在学习了回文串之后,一直觉得回文串不够优美,所以它决定自己定义一种新的字符串——镜像串 所谓镜像串,就是对一个字符串进行一整 阅读全文
posted @ 2019-08-04 09:36 Target--fly 阅读(347) 评论(0) 推荐(0)

摘要:单点时限: 2.0 sec 内存限制: 512 MB 单点时限: 2.0 sec 内存限制: 512 MB 单点时限: 2.0 sec 内存限制: 512 MB 还有一个月就开学了,爱学习的小蚂蚁想庆祝一下!于是它要把它的“家”装修一下。首先要做的就是贴地板。小蚂蚁“家”的地面可以看成一个2∗N 的 阅读全文
posted @ 2019-08-04 09:34 Target--fly 阅读(171) 评论(0) 推荐(0)

摘要:D. 蚂蚁平面 单点时限: 2.0 sec 内存限制: 512 MB 单点时限: 2.0 sec 内存限制: 512 MB 单点时限: 2.0 sec 内存限制: 512 MB 平面上有 n只蚂蚁,它走过的路径可以看作一条直线 由这n 条直线定义的某些区域是无界的,而另一些区域则是有界的。 有界区域 阅读全文
posted @ 2019-08-04 09:16 Target--fly 阅读(192) 评论(0) 推荐(0)

摘要:B. 蚂蚁觅食(二) 单点时限: 1.0 sec 内存限制: 512 MB 单点时限: 1.0 sec 内存限制: 512 MB 单点时限: 1.0 sec 内存限制: 512 MB 一只饥饿的小蚂蚁外出觅食,幸运的的小蚂蚁发现了好多食物。但是这些食物位于一个N∗M的方格魔法阵的右下角,而小蚂蚁位于 阅读全文
posted @ 2019-08-04 08:55 Target--fly 阅读(230) 评论(0) 推荐(0)

摘要:A. 蚂蚁觅食(一) 单点时限: 1.0 sec 内存限制: 512 MB 单点时限: 1.0 sec 内存限制: 512 MB 单点时限: 1.0 sec 内存限制: 512 MB 一只饥饿的小蚂蚁外出觅食,幸运的小蚂蚁发现了好多食物,但是它只有一次搬食物的机会。可因为力气太小了,它不能搬走重量超 阅读全文
posted @ 2019-08-04 00:21 Target--fly 阅读(202) 评论(0) 推荐(0)

摘要:题目描述 选取和不超过S的若干个不同的正整数,使得所有数的约数(不含它本身)之和最大。 选取和不超过S的若干个不同的正整数,使得所有数的约数(不含它本身)之和最大。 输入格式 输入一个正整数S。 输入一个正整数S。 输出格式 输出最大的约数之和。 输出最大的约数之和。 输入输出样例 输入 #1复制 阅读全文
posted @ 2019-08-02 20:59 Target--fly 阅读(204) 评论(0) 推荐(0)

摘要:Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s 阅读全文
posted @ 2019-08-02 17:45 Target--fly 阅读(143) 评论(0) 推荐(0)

摘要:题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1059 题目大意:有四堆糖果,称矩阵排列,一共有n行,只能在每一堆的最上方取糖果,病放入篮子中, 阅读全文
posted @ 2019-08-02 17:23 Target--fly 阅读(101) 评论(0) 推荐(0)

摘要:例题: http://www.51nod.com/Challenge/Problem.html#problemId=1183 编辑距离,又称Levenshtein距离(也叫做Edit Distance),是指两个字串之间,由一个转成另一个所需的最少编辑操作次数。许可的编辑操作包括将一个字符替换成另一 阅读全文
posted @ 2019-08-02 14:40 Target--fly 阅读(177) 评论(0) 推荐(0)

摘要:单点时限: 2.0 sec 内存限制: 512 MB 单点时限: 2.0 sec 内存限制: 512 MB 单点时限: 2.0 sec 内存限制: 512 MB “大猩猩为什么不喜欢平行线?”“因为平行线没有相交”哈哈哈哈哈哈哈哈哈 为了管理动物园不听话的大猩猩们,动物管理员Boctorio 决定去 阅读全文
posted @ 2019-08-01 21:41 Target--fly 阅读(296) 评论(0) 推荐(0)

摘要:单点时限: 2.0 sec 内存限制: 512 MB 单点时限: 2.0 sec 内存限制: 512 MB 单点时限: 2.0 sec 内存限制: 512 MB 对于数组a,如果i≠j并且ai+aj是一个质数,那么我们就称(i,j)为质数对,计算数组中质数对的个数。 输入格式 第一行输入一个n,表示 阅读全文
posted @ 2019-08-01 21:37 Target--fly 阅读(168) 评论(0) 推荐(0)

摘要:单点时限: 2.0 sec 内存限制: 512 MB 单点时限: 2.0 sec 内存限制: 512 MB 单点时限: 2.0 sec 内存限制: 512 MB 一个数组a,现在你需要删除某一项使得它们的gcd最大,求出这个最大值。 输入格式 第一行输入一个正整数n,表示数组的大小,接下来一行n个数 阅读全文
posted @ 2019-08-01 21:29 Target--fly 阅读(217) 评论(0) 推荐(0)

摘要:单点时限: 1.0 sec 内存限制: 512 MB 单点时限: 1.0 sec 内存限制: 512 MB 单点时限: 1.0 sec 内存限制: 512 MB 在十进制下,我们能够很轻易地判断一个小数的位数是有穷的或无穷的,但是把这个小数用二进制表示出的情况下其有穷性和无穷性就会发生改变,比如 十 阅读全文
posted @ 2019-08-01 21:24 Target--fly 阅读(273) 评论(0) 推荐(0)

摘要:矩阵乘法:(方阵n*n) 矩阵快速幂:(类似与快速幂运算):(注意返回值也是一个结构体‘’ 矩阵快速幂的几种类型题目 http://acm.hdu.edu.cn/showproblem.php?pid=5950 Farmer John likes to play mathematics games 阅读全文
posted @ 2019-08-01 16:26 Target--fly 阅读(187) 评论(0) 推荐(0)

摘要:1 getline 读入string库中的字符串 string a; getline(cin,a); 这样的读入要比任何一种读入字符串都有要快 2 char a[N]; cin.getline(a,size) 如果是用 char 定义的字符串 ,则可以cin.getline读入 3 getline的 阅读全文
posted @ 2019-08-01 16:15 Target--fly 阅读(389) 评论(0) 推荐(0)