08 2018 档案

摘要:Problem 现在请求你维护一个数列,要求提供以下两种操作:1、 查询操作。语法:Q L 功能:查询当前数列中末尾L个数中的最大的数,并输出这个数的值。限制:L不超过当前数列的长度。2、 插入操作。语法:A n 功能:将n加上t,其中t是最近一次查询操作的答案(如果... 阅读全文
posted @ 2018-08-29 21:24 Mercury_Lc 阅读(145) 评论(0) 推荐(0)
摘要:Problem 现在请求你维护一个数列,要求提供以下两种操作:1、 查询操作。语法:Q L 功能:查询当前数列中末尾L个数中的最大的数,并输出这个数的值。限制:L不超过当前数列的长度。2、 插入操作。语法:A n 功能:将n加上t,其中t是最近一次查询操作的答案(如果... 阅读全文
posted @ 2018-08-29 21:24 Mercury_Lc 阅读(73) 评论(0) 推荐(0)
摘要:题解:隔一段数字存一个答案,在查询时,只要找到距离n最近而且小于n的存答案值,再把剩余的暴力跑一遍就可以。#include using namespace std;const int N = 1e8 + 10;const int M = 2e6 + 10;double... 阅读全文
posted @ 2018-08-28 21:06 Mercury_Lc 阅读(195) 评论(0) 推荐(0)
摘要:Problem You are given an array of N integers and Q queries. Each query is a closed interval [l, r]. You should find the minimum absolu... 阅读全文
posted @ 2018-08-27 20:37 Mercury_Lc 阅读(138) 评论(0) 推荐(0)
摘要:Problem You are given an array of N integers and Q queries. Each query is a closed interval [l, r]. You should find the minimum absolu... 阅读全文
posted @ 2018-08-27 20:37 Mercury_Lc 阅读(90) 评论(0) 推荐(0)
摘要:离线算法算法设计策略都是基于在执行算法前输入数据已知的基本假设,也就是说,对于一个离线算法,在开始时就需要知道问题的所有输入数据,而且在解决一个问题后就要立即输出结果,通常将这类具有问题完全信息前提下设计出的算法成为离线算法( off line algorithms)... 阅读全文
posted @ 2018-08-27 19:41 Mercury_Lc 阅读(425) 评论(0) 推荐(0)
摘要:离线算法算法设计策略都是基于在执行算法前输入数据已知的基本假设,也就是说,对于一个离线算法,在开始时就需要知道问题的所有输入数据,而且在解决一个问题后就要立即输出结果,通常将这类具有问题完全信息前提下设计出的算法成为离线算法( off line algorithms)... 阅读全文
posted @ 2018-08-27 19:41 Mercury_Lc 阅读(181) 评论(0) 推荐(0)
摘要:在不知道需要输入多少个数,每个数之间有个空格,当输入换行时结束,如何进行读入操作。#include #include using namespace std;int a[150];int main(){ int n; char op; while(~... 阅读全文
posted @ 2018-08-26 18:40 Mercury_Lc 阅读(80) 评论(0) 推荐(0)
摘要:在不知道需要输入多少个数,每个数之间有个空格,当输入换行时结束,如何进行读入操作。#include #include using namespace std;int a[150];int main(){ int n; char op; while(~... 阅读全文
posted @ 2018-08-26 18:40 Mercury_Lc 阅读(89) 评论(0) 推荐(0)
摘要:Problem:Given the N integers, you have to find the maximum GCD (greatest common divisor) of every possible pair of these integers.Inpu... 阅读全文
posted @ 2018-08-25 21:26 Mercury_Lc 阅读(81) 评论(0) 推荐(0)
摘要:Problem:Given the N integers, you have to find the maximum GCD (greatest common divisor) of every possible pair of these integers.Inpu... 阅读全文
posted @ 2018-08-25 21:26 Mercury_Lc 阅读(198) 评论(0) 推荐(0)
摘要:int gcd(int x, int y){ return (!y) ? x : gcd( y, x % y );} 阅读全文
posted @ 2018-08-25 21:15 Mercury_Lc 阅读(156) 评论(0) 推荐(0)
摘要:int gcd(int x, int y){ return (!y) ? x : gcd( y, x % y );} 阅读全文
posted @ 2018-08-25 21:15 Mercury_Lc 阅读(111) 评论(0) 推荐(0)
摘要:转自:http://www.cnblogs.com/gamesky/archive/2013/01/09/2852356.html0、C++的输入输出分为三种:(1)基于控制台的I/O (2)基于文件的I/O (3)基于字符串的I/O ... 阅读全文
posted @ 2018-08-25 21:11 Mercury_Lc 阅读(132) 评论(0) 推荐(0)
摘要:转自:http://www.cnblogs.com/gamesky/archive/2013/01/09/2852356.html0、C++的输入输出分为三种:(1)基于控制台的I/O (2)基于文件的I/O (3)基于字符串的I/O ... 阅读全文
posted @ 2018-08-25 21:11 Mercury_Lc 阅读(118) 评论(0) 推荐(0)
摘要:题解:求一个数的次幂,然后输出前三位和后三位,后三位注意有前导0的情况。 后三位直接用快速幂取模求解。 前三位求得时候只需要稍微变形一下,可以把乘过的结果拆成用科学计数法,那么小数部分只有由前面决定,所以取前三位利用double来计算就可以了。#in... 阅读全文
posted @ 2018-08-25 09:04 Mercury_Lc 阅读(106) 评论(0) 推荐(0)
摘要:欧拉函数:对于一个正整数n,小于n且和n互质的正整数(包括1)的个数,记作φ(n) 。通式: 其中p1, p2……pn为x的所有质因数,x是不为0的整数。φ(1)=1(和1互质的数(小于等于1)就是1本身)。注意:每种质因数只一个。 比如12=2*2*3那么φ(12)... 阅读全文
posted @ 2018-08-24 20:46 Mercury_Lc 阅读(437) 评论(0) 推荐(0)
摘要:欧拉函数:对于一个正整数n,小于n且和n互质的正整数(包括1)的个数,记作φ(n) 。通式: 其中p1, p2……pn为x的所有质因数,x是不为0的整数。φ(1)=1(和1互质的数(小于等于1)就是1本身)。注意:每种质因数只一个。 比如12=2*2*3那么φ(12)... 阅读全文
posted @ 2018-08-24 20:46 Mercury_Lc 阅读(187) 评论(0) 推荐(0)
摘要:一个十进制整数被叫做权势二进制,当他的十进制表示的时候只由0或1组成。例如0,1,101,110011都是权势二进制而2,12,900不是。当给定一个n的时候,计算一下最少要多少个权势二进制相加才能得到n。Input单组测试数据。 第一行给出一个整数n (1#incl... 阅读全文
posted @ 2018-08-24 18:56 Mercury_Lc 阅读(120) 评论(0) 推荐(0)
摘要:一个十进制整数被叫做权势二进制,当他的十进制表示的时候只由0或1组成。例如0,1,101,110011都是权势二进制而2,12,900不是。当给定一个n的时候,计算一下最少要多少个权势二进制相加才能得到n。Input单组测试数据。 第一行给出一个整数n (1#incl... 阅读全文
posted @ 2018-08-24 18:56 Mercury_Lc 阅读(129) 评论(0) 推荐(0)
摘要:小K手中有n张牌,每张牌上有一个一位数的数,这个字数不是0就是5。小K从这些牌在抽出任意张(不能抽0张),排成一行这样就组成了一个数。使得这个数尽可能大,而且可以被90整除。注意:1.这个数没有前导0,2.小K不需要使用所有的牌。Input每个测试数据输入共2行。 第... 阅读全文
posted @ 2018-08-24 18:48 Mercury_Lc 阅读(208) 评论(0) 推荐(0)
摘要:小K手中有n张牌,每张牌上有一个一位数的数,这个字数不是0就是5。小K从这些牌在抽出任意张(不能抽0张),排成一行这样就组成了一个数。使得这个数尽可能大,而且可以被90整除。注意:1.这个数没有前导0,2.小K不需要使用所有的牌。Input每个测试数据输入共2行。 第... 阅读全文
posted @ 2018-08-24 18:48 Mercury_Lc 阅读(128) 评论(0) 推荐(0)
摘要:Problem Description"You shall not pass!"After shouted out that,the Force Staff appered in CaoHaha's hand.As we all know,the Force Staf... 阅读全文
posted @ 2018-08-24 10:04 Mercury_Lc 阅读(86) 评论(0) 推荐(0)
摘要:Problem Description"You shall not pass!"After shouted out that,the Force Staff appered in CaoHaha's hand.As we all know,the Force Staf... 阅读全文
posted @ 2018-08-24 10:04 Mercury_Lc 阅读(123) 评论(0) 推荐(0)
摘要:Problem DescriptionIt is well known that small groups are not conducive of the development of a team. Therefore, there shouldn’t be an... 阅读全文
posted @ 2018-08-24 08:48 Mercury_Lc 阅读(75) 评论(0) 推荐(0)
摘要:Problem DescriptionIt is well known that small groups are not conducive of the development of a team. Therefore, there shouldn’t be an... 阅读全文
posted @ 2018-08-24 08:48 Mercury_Lc 阅读(80) 评论(0) 推荐(0)
摘要:Problem Description 已知一棵二叉树的前序遍历和中序遍历,求二叉树的后序遍历和层序遍历。Input 输入数据有多组,第一行是一个整数t (t#include #include struct node{ char data; // 储存字符 ... 阅读全文
posted @ 2018-08-17 21:02 Mercury_Lc 阅读(107) 评论(0) 推荐(0)
摘要:Problem Description 已知一棵二叉树的前序遍历和中序遍历,求二叉树的后序遍历和层序遍历。Input 输入数据有多组,第一行是一个整数t (t#include #include struct node{ char data; // 储存字符 ... 阅读全文
posted @ 2018-08-17 21:02 Mercury_Lc 阅读(162) 评论(0) 推荐(0)
摘要:某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。 Input测试输入包含若干测... 阅读全文
posted @ 2018-08-17 19:47 Mercury_Lc 阅读(87) 评论(0) 推荐(0)
摘要:某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。 Input测试输入包含若干测... 阅读全文
posted @ 2018-08-17 19:47 Mercury_Lc 阅读(85) 评论(0) 推荐(0)
摘要:Problem DescriptionLarry graduated this year and finally has a job. He's making a lot of money, but somehow never seems to have enough... 阅读全文
posted @ 2018-08-17 10:16 Mercury_Lc 阅读(95) 评论(0) 推荐(0)
摘要:Problem DescriptionLarry graduated this year and finally has a job. He's making a lot of money, but somehow never seems to have enough... 阅读全文
posted @ 2018-08-17 10:16 Mercury_Lc 阅读(95) 评论(0) 推荐(0)
摘要:转自:http://www.renfei.org/blog/bipartite-matching.html 如有侵权,立即删除。这篇文章讲无权二分图(unweighted bipartite graph)的最大匹配(maximum matching)和完美匹配(per... 阅读全文
posted @ 2018-08-17 08:31 Mercury_Lc 阅读(112) 评论(0) 推荐(0)
摘要:转自:http://www.renfei.org/blog/bipartite-matching.html 如有侵权,立即删除。这篇文章讲无权二分图(unweighted bipartite graph)的最大匹配(maximum matching)和完美匹配(per... 阅读全文
posted @ 2018-08-17 08:31 Mercury_Lc 阅读(159) 评论(0) 推荐(0)
摘要:Problem Description已知一颗二叉树的前序遍历和中序遍历,求二叉树的层次遍历。Input输入数据有多组,输入T,代表有T组测试数据。每组数据有两个长度小于50的字符串,第一个字符串为前序遍历,第二个为中序遍历。Output每组输出这颗二叉树的层次遍历。... 阅读全文
posted @ 2018-08-16 21:00 Mercury_Lc 阅读(99) 评论(0) 推荐(0)
摘要:Problem Description已知一颗二叉树的前序遍历和中序遍历,求二叉树的层次遍历。Input输入数据有多组,输入T,代表有T组测试数据。每组数据有两个长度小于50的字符串,第一个字符串为前序遍历,第二个为中序遍历。Output每组输出这颗二叉树的层次遍历。... 阅读全文
posted @ 2018-08-16 21:00 Mercury_Lc 阅读(150) 评论(0) 推荐(0)
摘要:Problem Description一个长度不超过10000数据的顺序表,可能存在着一些值相同的“多余”数据元素(类型为整型),编写一个程序将“多余”的数据元素从顺序表中删除,使该表由一个“非纯表”(值相同的元素在表中可能有多个)变成一个“纯表”(值相同的元素在表中... 阅读全文
posted @ 2018-08-16 19:44 Mercury_Lc 阅读(354) 评论(0) 推荐(0)
摘要:Problem Description一个长度不超过10000数据的顺序表,可能存在着一些值相同的“多余”数据元素(类型为整型),编写一个程序将“多余”的数据元素从顺序表中删除,使该表由一个“非纯表”(值相同的元素在表中可能有多个)变成一个“纯表”(值相同的元素在表中... 阅读全文
posted @ 2018-08-16 19:44 Mercury_Lc 阅读(197) 评论(0) 推荐(0)
摘要:转自:https://blog.csdn.net/c20180630/article/details/70175814 作者:C20180630_zjf二分图的概念二分图又称作二部图,是图论中的一种特殊模型。 设G=(V, E)是一个无向图。如果顶点集V可分割为两个互... 阅读全文
posted @ 2018-08-15 20:36 Mercury_Lc 阅读(155) 评论(0) 推荐(0)
摘要:转自:https://blog.csdn.net/c20180630/article/details/70175814 作者:C20180630_zjf二分图的概念二分图又称作二部图,是图论中的一种特殊模型。 设G=(V, E)是一个无向图。如果顶点集V可分割为两个互... 阅读全文
posted @ 2018-08-15 20:36 Mercury_Lc 阅读(198) 评论(0) 推荐(0)
摘要:1、源文件头部注释列出:版权、作者、编写日期和描述。示例:/*************************************************Copyright:radiAuthor:Date:2018-08-14Description:描述主要实现的... 阅读全文
posted @ 2018-08-13 20:39 Mercury_Lc 阅读(213) 评论(0) 推荐(0)
摘要:1、源文件头部注释列出:版权、作者、编写日期和描述。示例:/*************************************************Copyright:radiAuthor:Date:2018-08-14Description:描述主要实现的... 阅读全文
posted @ 2018-08-13 20:39 Mercury_Lc 阅读(1582) 评论(0) 推荐(0)
摘要:ProblemThe Tower of Hanoi puzzle was invented by French mathematician Édouard Lucas in the second half of the 19th century. Here is it... 阅读全文
posted @ 2018-08-11 19:56 Mercury_Lc 阅读(87) 评论(0) 推荐(0)
摘要:ProblemThe Tower of Hanoi puzzle was invented by French mathematician Édouard Lucas in the second half of the 19th century. Here is it... 阅读全文
posted @ 2018-08-11 19:56 Mercury_Lc 阅读(127) 评论(0) 推荐(0)
摘要:ProblemA new academic year approaches, and the dean must make a schedule of classes for first-year students. There must be n classes i... 阅读全文
posted @ 2018-08-11 19:31 Mercury_Lc 阅读(143) 评论(0) 推荐(0)
摘要:ProblemA new academic year approaches, and the dean must make a schedule of classes for first-year students. There must be n classes i... 阅读全文
posted @ 2018-08-11 19:31 Mercury_Lc 阅读(109) 评论(0) 推荐(0)
摘要:Problem杭州电子科技大学即将迎来50周年的校庆,作为校庆委员会成员的我被上级要求设计一座神秘的建筑物来迎合校庆,因此我苦思冥想了一个月,终于设计出了一套方案,这座建筑物有点象古老埃及的金字塔,不过这个神秘建筑的根基是三角形的而不是矩形的,从数学的专业角度来讲,它... 阅读全文
posted @ 2018-08-10 20:25 Mercury_Lc 阅读(80) 评论(0) 推荐(0)
摘要:Problem杭州电子科技大学即将迎来50周年的校庆,作为校庆委员会成员的我被上级要求设计一座神秘的建筑物来迎合校庆,因此我苦思冥想了一个月,终于设计出了一套方案,这座建筑物有点象古老埃及的金字塔,不过这个神秘建筑的根基是三角形的而不是矩形的,从数学的专业角度来讲,它... 阅读全文
posted @ 2018-08-10 20:25 Mercury_Lc 阅读(102) 评论(0) 推荐(0)
摘要:北大ACM - POJ试题分类 —— By EXP 2017-12-03 转载请注明出处: by EXP http://exp-blog.com/2018/06/28/pid-38/相关推荐文: 旧版POJ分类目录: http://exp-blog.com/2018/... 阅读全文
posted @ 2018-08-10 11:28 Mercury_Lc 阅读(123) 评论(0) 推荐(0)
摘要:北大ACM - POJ试题分类 —— By EXP 2017-12-03 转载请注明出处: by EXP http://exp-blog.com/2018/06/28/pid-38/相关推荐文: 旧版POJ分类目录: http://exp-blog.com/2018/... 阅读全文
posted @ 2018-08-10 11:28 Mercury_Lc 阅读(167) 评论(0) 推荐(0)
摘要:1、如果我们要求一个数的所有因数的个数会怎么去求呢?首先想到最简单的方法就是暴力求解就可以。当然数据小、或者测试数据少就很简单就可以过了。2、如果求一个区间内的数的所有因数的个数呢?或者求一个区间内的数的因数最大的数以及最大的因数(正因数)的个数?这样的话,数据大一些... 阅读全文
posted @ 2018-08-10 11:09 Mercury_Lc 阅读(174) 评论(0) 推荐(0)
摘要:1、如果我们要求一个数的所有因数的个数会怎么去求呢?首先想到最简单的方法就是暴力求解就可以。当然数据小、或者测试数据少就很简单就可以过了。2、如果求一个区间内的数的所有因数的个数呢?或者求一个区间内的数的因数最大的数以及最大的因数(正因数)的个数?这样的话,数据大一些... 阅读全文
posted @ 2018-08-10 11:09 Mercury_Lc 阅读(2466) 评论(2) 推荐(1)
摘要:你必须非常努力,才能看起来毫不费力 有一群人,他们积极自律,每天按计划行事,有条不紊;他们不张扬,把自己当成最卑微的小草,等待着人生开出花朵的那天。他们早晨5点多起来健身,你在睡觉;7点开始享受丰盛的早餐,蛋白质维生素淀粉... 阅读全文
posted @ 2018-08-09 20:47 Mercury_Lc 阅读(126) 评论(0) 推荐(0)
摘要:你必须非常努力,才能看起来毫不费力 有一群人,他们积极自律,每天按计划行事,有条不紊;他们不张扬,把自己当成最卑微的小草,等待着人生开出花朵的那天。他们早晨5点多起来健身,你在睡觉;7点开始享受丰盛的早餐,蛋白质维生素淀粉... 阅读全文
posted @ 2018-08-09 20:47 Mercury_Lc 阅读(126) 评论(0) 推荐(0)
摘要:Problem Description解决图论问题,首先就要思考用什么样的方式存储图。但是小鑫却怎么也弄不明白如何存图才能有利于解决问题。你能帮他解决这个问题么?Input 多组输入,到文件结尾。每一组第一行有两个数n、m表示n个点,m条有向边。接下来有m行,每行两个... 阅读全文
posted @ 2018-08-09 20:24 Mercury_Lc 阅读(87) 评论(0) 推荐(0)
摘要:Problem Description解决图论问题,首先就要思考用什么样的方式存储图。但是小鑫却怎么也弄不明白如何存图才能有利于解决问题。你能帮他解决这个问题么?Input 多组输入,到文件结尾。每一组第一行有两个数n、m表示n个点,m条有向边。接下来有m行,每行两个... 阅读全文
posted @ 2018-08-09 20:24 Mercury_Lc 阅读(119) 评论(0) 推荐(0)
摘要:Problem Description曾经,ZYJ同学非常喜欢密码学。有一天,他发现了一个很长很长的字符串S1。他很好奇那代表着什么,于是神奇的WL给了他另一个字符串S2。但是很不幸的是,WL忘记跟他说是什么意思了。这个时候,ZYJ不得不求助与伟大的ZP。ZP笑了笑说... 阅读全文
posted @ 2018-08-09 16:12 Mercury_Lc 阅读(117) 评论(0) 推荐(0)
摘要:Problem Description曾经,ZYJ同学非常喜欢密码学。有一天,他发现了一个很长很长的字符串S1。他很好奇那代表着什么,于是神奇的WL给了他另一个字符串S2。但是很不幸的是,WL忘记跟他说是什么意思了。这个时候,ZYJ不得不求助与伟大的ZP。ZP笑了笑说... 阅读全文
posted @ 2018-08-09 16:12 Mercury_Lc 阅读(154) 评论(0) 推荐(0)
摘要:Problem Description “回文串”是一个正读和反读都一样的字符串,比如“level”或者“noon”等等就是回文串。现在呢,就是让你判断输入的字符串是否是回文串。Input 有多组输入,每行输入一串字符,保证字符串长度不会大于 100000... 阅读全文
posted @ 2018-08-08 20:46 Mercury_Lc 阅读(90) 评论(0) 推荐(0)
摘要:Problem Description “回文串”是一个正读和反读都一样的字符串,比如“level”或者“noon”等等就是回文串。现在呢,就是让你判断输入的字符串是否是回文串。Input 有多组输入,每行输入一串字符,保证字符串长度不会大于 100000... 阅读全文
posted @ 2018-08-08 20:46 Mercury_Lc 阅读(230) 评论(0) 推荐(0)
摘要:ProblemThis year at Monsters University it is decided to arrange Scare Games. At the Games all campus gathers at the stadium stands, a... 阅读全文
posted @ 2018-08-08 18:14 Mercury_Lc 阅读(127) 评论(0) 推荐(0)
摘要:ProblemGrisha N. told his two teammates that he was going to solve all given problems at the subregional contest, even if the teammate... 阅读全文
posted @ 2018-08-08 17:25 Mercury_Lc 阅读(235) 评论(0) 推荐(0)
摘要:Problem Description在哥尼斯堡的一个公园里,有七座桥将普雷格尔河中两个岛及岛与河岸连接起来。能否走过这样的七座桥,并且每桥只走一次?瑞士数学家欧拉最终解决了这个问题并由此创立了拓扑学。欧拉通过对七桥问题的研究,不仅圆满地回答了哥尼斯堡七桥问题,并证明... 阅读全文
posted @ 2018-08-07 14:49 Mercury_Lc 阅读(132) 评论(0) 推荐(0)
摘要:ProblemAlice lives in the country where people like to make friends. The friendship is bidirectional and if any two person have no les... 阅读全文
posted @ 2018-08-06 20:05 Mercury_Lc 阅读(141) 评论(0) 推荐(0)
摘要:ProblemThe vast power system is the most complicated man-made system and the greatest engineering innovation in the 20th century. The ... 阅读全文
posted @ 2018-08-06 19:51 Mercury_Lc 阅读(149) 评论(0) 推荐(0)
摘要:ProblemThe balance was the first mass measuring instrument invented. In its traditional form, it consists of a pivoted horizontal leve... 阅读全文
posted @ 2018-08-06 19:33 Mercury_Lc 阅读(227) 评论(0) 推荐(0)
摘要:题解:就是题目有点小长而已,可能会不想读题,但是题意蛮好理解的,就是根据条件模拟,计算pts。(送给队友zm、 qsh,你们不适合训练了。)#include #include #include #include #include #include #include u... 阅读全文
posted @ 2018-08-06 19:13 Mercury_Lc 阅读(231) 评论(0) 推荐(0)
摘要:Problem很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测... 阅读全文
posted @ 2018-08-06 09:46 Mercury_Lc 阅读(118) 评论(0) 推荐(0)
摘要:Problem Description转置运算是一种最简单的矩阵运算,对于一个m*n的矩阵M( 1 = #include #include #include #include #include #include #include using namespace std... 阅读全文
posted @ 2018-08-06 09:34 Mercury_Lc 阅读(143) 评论(0) 推荐(0)
摘要:原文地址:http://blog.csdn.net/zearot/article/details/48299459(如有侵权,请联系博主,立即删除。)线段树详解 By 岩之痕目录:一:综述 二:原理 三:递归实现 四:非递归原理 ... 阅读全文
posted @ 2018-08-04 16:54 Mercury_Lc 阅读(168) 评论(0) 推荐(0)
摘要:Problem Description数组——矩阵的转置给定一个m*n的矩阵(m,n#include int a[105][105];int main(){ int n, m; while(~scanf("%d %d", &n, &m)) { ... 阅读全文
posted @ 2018-08-04 11:09 Mercury_Lc 阅读(278) 评论(0) 推荐(0)
摘要:Problem Description 给定两个字符串string1和string2,将字符串string2连接在string1的后面,并将连接后的字符串输出。连接后字符串长度不超过110。 Input 输入包含多组数据,每组测试数据包含两行,第一行代表string1... 阅读全文
posted @ 2018-08-04 10:46 Mercury_Lc 阅读(196) 评论(0) 推荐(0)
摘要:Problem Description对于一个n*n的稀疏矩阵M(1 using namespace std;struct node{ int x,y,z;} s[55];int main(){ int mu, nu, tu; int key; ... 阅读全文
posted @ 2018-08-04 09:58 Mercury_Lc 阅读(198) 评论(0) 推荐(0)
摘要:A Simple Problem with IntegersTime Limit: 5000MS Memory Limit: 131... 阅读全文
posted @ 2018-08-03 20:49 Mercury_Lc 阅读(92) 评论(0) 推荐(0)
摘要:Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以... 阅读全文
posted @ 2018-08-03 20:43 Mercury_Lc 阅读(116) 评论(0) 推荐(0)
摘要:线段树(结构体)模板#include#include#include#include#include#include#include#includeusing namespace std;typedef long long ll;int ans;struct node... 阅读全文
posted @ 2018-08-03 20:27 Mercury_Lc 阅读(352) 评论(0) 推荐(1)
摘要:一直没碰过线段树,个人认为好长好难,不过这几天做题遇到了裸的线段树的题,TAT。线段树我理解就是把二叉树的左右节点现在分别看成是两个区间。那么现在这两个区间的端点怎么存放?怎么能够把这个区间里的数(一般指的就是在这个区间的数值的和)存放起来呢?比较传统化的是用一个结构... 阅读全文
posted @ 2018-08-03 20:01 Mercury_Lc 阅读(109) 评论(0) 推荐(0)
摘要:cyk追楠神系列一 Time Limit: 1000 ms Memo... 阅读全文
posted @ 2018-08-01 08:58 Mercury_Lc 阅读(256) 评论(0) 推荐(0)