kZjPBD.jpg

07 2019 档案

摘要:题目链接: https://cn.vjudge.net/contest/313499#problem/L SOLUTION: 对于题意,要求最短的表达式,当用最小循环元来表示一个字符串时,其表达式才最短。对于字符串S自匹配求出next数组,分析可以发现:当i-next[i]能整除i时,S[1~i-n 阅读全文
posted @ 2019-07-31 20:52 Through_The_Night 阅读(142) 评论(0) 推荐(0) 编辑
摘要:题目描述 给出一个长度为 的数列 和一个长度为 的数列 ,求 有多少个长度为 的连续子数列能与 匹配。 两个数列可以匹配,当且仅当存在一种方案,使两个数列中的数可以两两配对,两个数可以配对当且仅当它们的和不小于 。 题目描述 给出一个长度为 的数列 和一个长度为 的数列 ,求 有多少个长度为 的连续 阅读全文
posted @ 2019-07-30 16:17 Through_The_Night 阅读(311) 评论(0) 推荐(0) 编辑
摘要:Song Zha Zha has an 11-indexed array A . Li Zha Zha has QQ queries . Each query has two integers LL, RR , asking Ran Zha Zha to do the following thing 阅读全文
posted @ 2019-07-30 14:56 Through_The_Night 阅读(652) 评论(0) 推荐(0) 编辑
摘要:Consider an array AA with n elements . Each of its element is A[i]A[i] (1 \le i \le n)(1≤i≤n) . Then gives two integers QQ, KK, and QQ queries follow 阅读全文
posted @ 2019-07-28 11:09 Through_The_Night 阅读(347) 评论(0) 推荐(0) 编辑
摘要:题意翻译 Description 已知一个长度为n的序列a1,a2,…,an。 对于每个1<=i<=n,找到最小的非负整数p满足 对于任意的j, aj < = ai + p – sqrt(abs(i-j)) Input 第一行n,(1<=n<=500000) 下面每行一个整数,其中第i行是ai。(0 阅读全文
posted @ 2019-07-27 10:06 Through_The_Night 阅读(215) 评论(0) 推荐(0) 编辑
摘要:题目大意:中文题目 具体思路:通过两棵线段树来维护,第一棵线段树来维护当前坐标的点的日增长速度(默认每一年的增长速度都是当前年份的增长速度),对于第一棵线段树,肯定会存在多算的情况,那么我们第二棵线段树就维护每一个点的多算的情况就可以了。 举个例子:当前的n只有1,初始值也是1, 三个操作,第一年加 阅读全文
posted @ 2019-07-25 19:04 Through_The_Night 阅读(219) 评论(0) 推荐(0) 编辑
摘要:E. Gosha is hunting time limit per test 5 seconds memory limit per test 256 megabytes input standard input output standard output E. Gosha is hunting 阅读全文
posted @ 2019-07-25 10:01 Through_The_Night 阅读(179) 评论(0) 推荐(0) 编辑
摘要:D2. RGB Substring (hard version) time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output D2. RGB 阅读全文
posted @ 2019-07-25 09:03 Through_The_Night 阅读(361) 评论(0) 推荐(0) 编辑
摘要:Define S[n] as the number of subsets of {1, 2, ..., n} that contain no consecutive integers. For each S[n], if for all i (1 ≤ i < n) gcd(S[i], S[n]) i 阅读全文
posted @ 2019-07-24 19:58 Through_The_Night 阅读(193) 评论(0) 推荐(0) 编辑
摘要:题意 有p个邮局,n个村庄,邮局只能建在村庄里, 求令所有寄信距离之和最短的值。、 SOLUTION: 首先可以n3的dp dp i ,j 表示前 i 个地方建立 j 个邮局的最小花费, 在处理出在任意一个区间建立一个邮局是的最小花费(一个区间放一个邮局的话,放在中位数的位置最有) 在想如何优化dp 阅读全文
posted @ 2019-07-24 10:28 Through_The_Night 阅读(160) 评论(0) 推荐(0) 编辑
摘要:There are nnn heroes and mmm monsters living in an island. The monsters became very vicious these days, so the heroes decided to diminish the monsters 阅读全文
posted @ 2019-07-23 14:42 Through_The_Night 阅读(377) 评论(0) 推荐(0) 编辑
摘要:Your friend has made a computer video game called "Kangaroo Puzzle" and wants you to give it a try for him. As the name of this game indicates, there 阅读全文
posted @ 2019-07-23 12:53 Through_The_Night 阅读(708) 评论(0) 推荐(0) 编辑
摘要:In the 24th24^{\text{th}}24th century, there is a country somewhere in the universe, namely Country Meow. Due to advanced technology, people can easil 阅读全文
posted @ 2019-07-22 19:50 Through_The_Night 阅读(368) 评论(0) 推荐(0) 编辑
摘要:You ye Jiu yuan is the daughter of the Great GOD Emancipator. And when she becomes an adult, she will be queen of Tusikur, so she wanted to travel the 阅读全文
posted @ 2019-07-21 18:22 Through_The_Night 阅读(321) 评论(0) 推荐(0) 编辑
摘要:题意 给出 NN 种零件,现在你可以用连续的一些零件组装成为一个产品,组装完你可以获得 ww 的价值,要求每种零件最多使用 KK 次并且每一个产品只能生产一个。问你最多可以获得的价值是多少。 思路 由于给出的 NN 很大, MM很小,那么显然,很多点都是没有用的,那么我们就可以将他们舍弃掉,只使用出 阅读全文
posted @ 2019-07-21 15:08 Through_The_Night 阅读(166) 评论(0) 推荐(0) 编辑
摘要:A prince of the Science Continent was imprisoned in a castle because of his contempt for mathematics when he was young, and was entangled in some math 阅读全文
posted @ 2019-07-18 15:19 Through_The_Night 阅读(234) 评论(0) 推荐(0) 编辑
摘要:#include #include #include #include #include #include #include #include #include #include using namespace std; #define rep(i,a,n) for (int i=a;i=a;i--) #define pb push_back #define mp make_p... 阅读全文
posted @ 2019-07-17 22:55 Through_The_Night 阅读(252) 评论(0) 推荐(0) 编辑
摘要:给你一个n*n的矩阵A,和一个m*m的矩阵B(m%2==1) B是卷积核,让你用B对A做t次卷积运算,并且对于A中的每一个元素计算出来的值要模2,所以A最后会是一个01矩阵。 问你经过t此后,A中有多少个元素=1 1<=t<=1e9,1<=n<=8,1<=m<=n SOLUTION: 二维矩阵展成1 阅读全文
posted @ 2019-07-17 17:51 Through_The_Night 阅读(244) 评论(0) 推荐(0) 编辑
摘要:Given a positive integers nn , Mobius function \mu(n)μ(n) is defined as follows: \displaystyle \mu(n) = \begin{cases} 1 &n = 1 \\ (-1)^k & n = p_1p_2\ 阅读全文
posted @ 2019-07-17 13:21 Through_The_Night 阅读(244) 评论(0) 推荐(0) 编辑
摘要:In a world where ordinary people cannot reach, a boy named "Koutarou" and a girl named "Sena" are playing a video game. The game system of this video 阅读全文
posted @ 2019-07-15 22:16 Through_The_Night 阅读(255) 评论(0) 推荐(0) 编辑
摘要:After Incident, a feast is usually held in Hakurei Shrine. This time Reimu asked Kokoro to deliver a Nogaku show during the feast. To enjoy the show, 阅读全文
posted @ 2019-07-15 19:30 Through_The_Night 阅读(251) 评论(0) 推荐(0) 编辑
摘要:Description You are given N points in the xy-plane. You have a circle of radius one and move it on the xy-plane, so as to enclose as many of the point 阅读全文
posted @ 2019-07-14 16:09 Through_The_Night 阅读(485) 评论(0) 推荐(0) 编辑
摘要:We define a function gay(i)gay(i): \displaystyle gay(i)=\left\{ \begin{array}{rcl} & 0, \quad& if \quad i = k*x*x, x > 1, k \geq 1 \\ & i * i ,\quad& 阅读全文
posted @ 2019-07-13 22:56 Through_The_Night 阅读(248) 评论(0) 推荐(0) 编辑
摘要:小 X 自幼就很喜欢数。但奇怪的是,他十分讨厌完全平方数。他觉得这些数看起来很令人难受。由此,他也讨厌所有是完全平方数的正整数倍的数。然而这丝毫不影响他对其他数的热爱。 这天是小X的生日,小 W 想送一个数给他作为生日礼物。当然他不能送一个小X讨厌的数。他列出了所有小X不讨厌的数,然后选取了第 K个 阅读全文
posted @ 2019-07-13 15:46 Through_The_Night 阅读(228) 评论(0) 推荐(0) 编辑
摘要:Given a rooted tree ( the root is node 11 ) of NN nodes. Initially, each node has zero point. Then, you need to handle QQ operations. There're two typ 阅读全文
posted @ 2019-07-13 12:49 Through_The_Night 阅读(185) 评论(0) 推荐(0) 编辑
摘要:给出一个长为 n​n​ 的数列,以及 n​n​ 个操作,操作涉及区间加法,询问区间内小于某个值 x​x​ 的前驱(比其小的最大元素)。 Input 第一行输入一个数字 n,1≤n≤100000n,1≤n≤100000。 第二行输入 nn 个非负整数,第 ii个数字为 ai(0≤ai≤109)ai(0 阅读全文
posted @ 2019-07-12 22:19 Through_The_Night 阅读(247) 评论(0) 推荐(0) 编辑
摘要:一、从应对考试角度来(在最快的时间内得出最准确的答案) 首先我们应该知道,要想将中缀转化为后缀,需要借助堆栈实现。(不准备画图了,画图有点浪费时间)我会用最简单明了的语言使读者弄懂。[举个例子吧:比如将:2*(9+6/3-5)+4转化为后缀表达式2 9 6 3 / +5 - * 4 + ] 1、任何 阅读全文
posted @ 2019-07-12 18:57 Through_The_Night 阅读(650) 评论(0) 推荐(0) 编辑
摘要:"Oh, There is a bipartite graph.""Make it Fantastic." X wants to check whether a bipartite graph is a fantastic graph. He has two fantastic numbers, a 阅读全文
posted @ 2019-07-12 16:38 Through_The_Night 阅读(182) 评论(0) 推荐(0) 编辑
摘要:题意: 给n个点,及m根pipe,每根pipe用来流躺液体的,单向的,每时每刻每根pipe流进来的物质要等于流出去的物质,要使得m条pipe组成一个循环体,里面流躺物质。 并且满足每根pipe一定的流量限制,范围为[Li,Ri].即要满足每时刻流进来的不能超过Ri(最大流问题),同时最小不能低于Li 阅读全文
posted @ 2019-07-12 14:29 Through_The_Night 阅读(129) 评论(0) 推荐(0) 编辑
摘要:A sequence of integer \lbrace a_n \rbrace{an​} can be expressed as: \displaystyle a_n = \left\{ \begin{array}{lr} 0, & n=0\\ 2, & n=1\\ \frac{3a_{n-1} 阅读全文
posted @ 2019-07-11 19:19 Through_The_Night 阅读(273) 评论(0) 推荐(0) 编辑
摘要:One day in the jail, F·F invites Jolyne Kujo (JOJO in brief) to play tennis with her. However, Pucci the father somehow knows it and wants to stop her 阅读全文
posted @ 2019-07-11 14:32 Through_The_Night 阅读(255) 评论(0) 推荐(0) 编辑
摘要:。。 阅读全文
posted @ 2019-07-11 14:03 Through_The_Night 阅读(81) 评论(0) 推荐(0) 编辑
摘要:题目背景 在一个叫做Travian的世界里,生活着各个大大小小的部落。其中最为强大的是罗马、高卢和日耳曼。他们之间为了争夺资源和土地,进行了无数次的战斗。期间诞生了众多家喻户晓的英雄人物,也留下了许多可歌可泣的动人故事。 其中,在大大小小的部落之间,会有一些道路相连,这些道路是Travian世界里的 阅读全文
posted @ 2019-07-10 22:09 Through_The_Night 阅读(278) 评论(0) 推荐(0) 编辑
摘要:题目描述 小强要在NNN个孤立的星球上建立起一套通信系统。这套通信系统就是连接NNN个点的一个树。 这个树的边是一条一条添加上去的。在某个时刻,一条边的负载就是它所在的当前能够 联通的树上路过它的简单路径的数量。 例如,在上图中,现在一共有了555条边。其中,(3,8)(3,8)(3,8)这条边的负 阅读全文
posted @ 2019-07-10 11:31 Through_The_Night 阅读(195) 评论(0) 推荐(0) 编辑
摘要:题目描述 某天,Lostmonkey发明了一种超级弹力装置,为了在他的绵羊朋友面前显摆,他邀请小绵羊一起玩个游戏。游戏一开始,Lostmonkey在地上沿着一条直线摆上n个装置,每个装置设定初始弹力系数ki,当绵羊达到第i个装置时,它会往后弹ki步,达到第i+ki个装置,若不存在第i+ki个装置,则 阅读全文
posted @ 2019-07-09 16:22 Through_The_Night 阅读(175) 评论(0) 推荐(0) 编辑
摘要:辉辉热衷于洞穴勘测。 某天,他按照地图来到了一片被标记为JSZX的洞穴群地区。经过初步勘测,辉辉发现这片区域由n个洞穴(分别编号为1到n)以及若干通道组成,并且每条通道连接了恰好两个洞穴。假如两个洞穴可以通过一条或者多条通道按一定顺序连接起来,那么这两个洞穴就是连通的,按顺序连接在一起的这些通道则被 阅读全文
posted @ 2019-07-09 15:11 Through_The_Night 阅读(158) 评论(0) 推荐(0) 编辑
摘要:题目背景 动态树 题目描述 给定n个点以及每个点的权值,要你处理接下来的m个操作。操作有4种。操作从0到3编号。点从1到n编号。 0:后接两个整数(x,y),代表询问从x到y的路径上的点的权值的xor和。保证x到y是联通的。 1:后接两个整数(x,y),代表连接x到y,若x到y已经联通则无需连接。 阅读全文
posted @ 2019-07-09 12:10 Through_The_Night 阅读(142) 评论(0) 推荐(0) 编辑
摘要:Shinku is very interested in the set. One day, she got nnn sets, and the iii-th number aia_iai​ is in the iii-th set. But she doesn't think it is inte 阅读全文
posted @ 2019-07-07 22:03 Through_The_Night 阅读(309) 评论(0) 推荐(0) 编辑
摘要:Jerome just got several large houses as his 18th18^{th}18th birthday gifts. To decorate one of these houses, he intends to place several carpets in hi 阅读全文
posted @ 2019-07-07 16:06 Through_The_Night 阅读(282) 评论(0) 推荐(0) 编辑
摘要:Once upon a time, in the mystical continent, there is a frog kingdom, ruled by the oldest frog, the Elder. The kingdom consists of N cities, numbered 阅读全文
posted @ 2019-07-07 11:41 Through_The_Night 阅读(269) 评论(0) 推荐(0) 编辑
摘要:给定一颗树,树中每个结点有一个邮递员,每个邮递员要沿着唯一的路径走向capital(1号结点),每到一个城市他可以有两种选择: 1.继续走到下个城市 2.让这个城市的邮递员替他出发。 每个邮递员出发需要一个准备时间W[I],他们的速度是V[I],表示走一公里需要多少分钟。 现在要你求出每个城市的邮递 阅读全文
posted @ 2019-07-06 21:33 Through_The_Night 阅读(239) 评论(0) 推荐(0) 编辑
摘要:机器上有N个需要处理的任务,它们构成了一个序列。这些任务被标号为1到N,因此序列的排列为1,2,3...N。这N个任务被分成若干批,每批包含相邻的若干任务。从时刻0开始,这些任务被分批加工,第i个任务单独完成所需的时间是Ti。在每批任务开始前,机器需要启动时间S,而完成这批任务所需的时间是各个任务需 阅读全文
posted @ 2019-07-04 20:02 Through_The_Night 阅读(134) 评论(0) 推荐(0) 编辑
摘要:2618: [Cqoi2006]凸多边形 Description 逆时针给出n个凸多边形的顶点坐标,求它们交的面积。例如n=2时,两个凸多边形如下图: 则相交部分的面积为5.233。 逆时针给出n个凸多边形的顶点坐标,求它们交的面积。例如n=2时,两个凸多边形如下图: 则相交部分的面积为5.233。 阅读全文
posted @ 2019-07-02 21:16 Through_The_Night 阅读(136) 评论(0) 推荐(0) 编辑
摘要:题目描述 A 国共有 n 座城市,这些城市由 n-1 条道路相连,使得任意两座城市可以互达,且路径唯一。每座城市都有一个幸运数字,以纪念碑的形式矗立在这座城市的正中心,作为城市的象征。 一些旅行者希望游览 A 国。旅行者计划乘飞机降落在 x 号城市,沿着 x 号城市到 y 号城市之间那条唯一的路径游 阅读全文
posted @ 2019-07-01 10:39 Through_The_Night 阅读(201) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示