08 2019 档案

摘要:题目: You may not know this but it's a fact that Xinghai Square is Asia's largest city square. It is located in Dalian and, of course, a landmark of the 阅读全文
posted @ 2019-08-30 13:23 Spring-Onion 阅读(232) 评论(0) 推荐(0)
摘要:题目描述 Amy asks Mr. B problem E. Please help Mr. B to solve the following problem. There are n people, who don't know each other at the beginning. There 阅读全文
posted @ 2019-08-15 21:42 Spring-Onion 阅读(198) 评论(0) 推荐(0)
摘要:题目描述 Amy asks Mr. B problem B. Please help Mr. B to solve the following problem. Let p = 1000000007. Given two integers b and c, please find two integ 阅读全文
posted @ 2019-08-15 20:50 Spring-Onion 阅读(591) 评论(0) 推荐(0)
摘要:题目: 给定长度为N的序列A,构造一个长度为N的序列B,满足: 1、B非严格单调,即B1≤B2≤…≤BN或B1≥B2≥…≥BN。2、最小化 S=∑Ni=1|Ai−Bi|。 只需要求出这个最小值S。 输入格式 第一行包含一个整数N。 接下来N行,每行包含一个整数Ai。 输出格式 输出一个整数,表示最小 阅读全文
posted @ 2019-08-15 00:02 Spring-Onion 阅读(289) 评论(0) 推荐(0)
摘要:一.最长上升子序列(LIS) LIS(Longest Increasing Subsequence)最长上升子序列 一个数的序列bi,当b1 < b2 < … < bS的时候,我们称这个序列是上升的。 对于给定的一个序列(a1, a2, …, aN),我们可以得到一些上升的子序列(ai1, ai2, 阅读全文
posted @ 2019-08-14 23:26 Spring-Onion 阅读(239) 评论(0) 推荐(0)
摘要:Problem Description Calabash is the servant of a landlord. The landlord owns a piece of land, which can be regarded as an infinite 2D plane.One day th 阅读全文
posted @ 2019-08-14 21:25 Spring-Onion 阅读(276) 评论(0) 推荐(0)
摘要:Problem Description Considering the overall difficulty of other problems, we invite Quailty to propose an easy problem for this contest.Quailty accide 阅读全文
posted @ 2019-08-14 21:15 Spring-Onion 阅读(495) 评论(0) 推荐(0)
摘要:Problem Description Roundgod is a famous milk tea lover at Nanjing University second to none. This year, he plans to conduct a milk tea festival. Ther 阅读全文
posted @ 2019-08-14 21:10 Spring-Onion 阅读(390) 评论(0) 推荐(1)
摘要:题目: Consider a N*N*N lattice. One corner is at (0,0,0) and the opposite one is at (N,N,N). How many lattice points are visible from corner at (0,0,0) 阅读全文
posted @ 2019-08-11 17:17 Spring-Onion 阅读(203) 评论(0) 推荐(0)
摘要:题目: 题目描述在完成了分配任务之后,西部314来到了楼兰古城的西部。 相传很久以前这片土地上(比楼兰古城还早)生活着两个部落,一个部落崇拜尖刀(‘V’),一个部落崇拜铁锹(‘∧’),他们分别用V和∧的形状来代表各自部落的图腾。 西部314在楼兰古城的下面发现了一幅巨大的壁画,壁画上被标记出了N个点 阅读全文
posted @ 2019-08-11 16:26 Spring-Onion 阅读(460) 评论(0) 推荐(0)
摘要:题目: 小A和小B在玩一个游戏。 首先,小A写了一个由0和1组成的序列S,长度为N。 然后,小B向小A提出了M个问题。 在每个问题中,小B指定两个数 l 和 r,小A回答 S[l~r] 中有奇数个1还是偶数个1。 机智的小B发现小A有可能在撒谎。 例如,小A曾经回答过 S[1~3] 中有奇数个1, 阅读全文
posted @ 2019-08-09 16:42 Spring-Onion 阅读(518) 评论(0) 推荐(2)
摘要:题目: 有一个划分为N列的星际战场,各列依次编号为1,2,…,N。 有N艘战舰,也依次编号为1,2,…,N,其中第i号战舰处于第i列。 有T条指令,每条指令格式为以下两种之一: 1、M i j,表示让第i号战舰所在列的全部战舰保持原有顺序,接在第j号战舰所在列的尾部。 2、C i j,表示询问第i号 阅读全文
posted @ 2019-08-09 15:41 Spring-Onion 阅读(199) 评论(0) 推荐(0)
摘要:题目: 在实现程序自动分析的过程中,常常需要判定一些约束条件是否能被同时满足。 考虑一个约束满足问题的简化版本:假设x1,x2,x3,…代表程序中出现的变量,给定n个形如xi=xjxi=xj或xi≠xjxi≠xj的变量相等/不等的约束条件,请判定是否可以分别为每一个变量赋予恰当的值,使得上述所有约束 阅读全文
posted @ 2019-08-09 14:11 Spring-Onion 阅读(302) 评论(0) 推荐(1)
摘要:该博客借鉴大佬博客理论内容:https://www.cnblogs.com/xenny/p/9739600.html 1.什么是树状数组? 顾名思义,就是用数组来模拟树形结构呗。那么衍生出一个问题,为什么不直接建树?答案是没必要,因为树状数组能处理的问题就没必要建树。和Trie树的构造方式有类似之处 阅读全文
posted @ 2019-08-09 11:33 Spring-Onion 阅读(322) 评论(0) 推荐(0)
摘要:题目: 给定长度为N的数列A,以及M条指令,每条指令可能是以下两种之一: 1、“1 x y”,查询区间 [x,y] 中的最大连续子段和,即 2、“2 x y”,把 A[x] 改成 y。 对于每个查询指令,输出一个整数表示答案。 输入格式 第一行两个整数N,M。 第二行N个整数A[i]。 接下来M行每 阅读全文
posted @ 2019-08-08 18:29 Spring-Onion 阅读(163) 评论(0) 推荐(0)
摘要:题目: Devu有N个盒子,第i个盒子中有Ai枝花。 同一个盒子内的花颜色相同,不同盒子内的花颜色不同。 Devu要从这些盒子中选出M枝花组成一束,求共有多少种方案。 若两束花每种颜色的花的数量都相同,则认为这两束花是相同的方案。 结果需对109+7取模之后方可输出。 输入格式 第一行包含两个整数N 阅读全文
posted @ 2019-08-06 17:26 Spring-Onion 阅读(355) 评论(0) 推荐(0)