摘要: 题目 This is yet another problem on regular bracket sequences. A bracket sequence is called regular, if by inserting "+" and "1" into it we get a correc 阅读全文
posted @ 2020-05-17 22:42 YouXam 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 题目 Fires can be disastrous, especially when a fire breaks out in a room that is completely filled with people. Rooms usually have a couple of exits an 阅读全文
posted @ 2020-05-15 22:00 YouXam 阅读(171) 评论(0) 推荐(0) 编辑
摘要: # 题目 FJ's \(N (1 ≤ N ≤ 10,000)\) cows conveniently indexed 1..N are standing in a line. Each cow has a positive integer height (which is a bit of secr 阅读全文
posted @ 2020-05-15 19:20 YouXam 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 题目 为了使得大家高兴,小Q特意出个自认为的简单题(easy)来满足大家,这道简单题是描述如下: 有一个数列A已知对于所有的$A[i]$都是1~n的自然数,并且知道对于一些$A[i]$不能取哪些值,我们定义一个数列的积为该数列所有元素的乘积,要求你求出所有可能的数列的积的和 $mod 1000000 阅读全文
posted @ 2020-05-13 20:32 YouXam 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 题目 这是一个简单的游戏,在一个n n的矩阵中,找n个数使得这n个数都在不同的行和列里并且要求这n个数中的最大值和最小值的差值最小。 输入格式 输入一个整数$T$表示$T$组数据。 对于每组数据第一行输入一个正整数$n(1 define inf 0x3f3f3f3f using namespace 阅读全文
posted @ 2020-05-12 20:08 YouXam 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 题目 题解 其实就是一个KM的板子 KM算法在进行中, 需要满足两个点的顶标值之和大于等于两点之间的边权, 所以进行一次KM即可. KM之后, 顶标之和就是最小的。因为如果不是最小的,就能通过修改顶标值来使某对顶点的顶标值满足$wx[i]+ly[j]==w[i][j]$,这样相等子图中又会多一条边, 阅读全文
posted @ 2020-05-10 22:42 YouXam 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 题目 You are given a positive integer $N(1≦N≦10^{18})$. Find the number of the pairs of integers $u$ and $v (0≦u,v≦N)$ such that there exist two non-neg 阅读全文
posted @ 2020-05-09 21:45 YouXam 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 题目 You are given a weighed undirected connected graph, consisting of n vertices and m edges. You should answer q queries, the i th query is to find th 阅读全文
posted @ 2020-05-08 22:24 YouXam 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 题目 Some time ago Mister B detected a strange signal from the space, which he started to study. After some transformation the signal turned out to be a 阅读全文
posted @ 2020-05-08 20:11 YouXam 阅读(160) 评论(0) 推荐(1) 编辑
摘要: 题目 City C is really a nightmare of all drivers for its traffic jams. To solve the traffic problem, the mayor plans to build a RTQS (Real Time Query Sy 阅读全文
posted @ 2020-05-06 22:22 YouXam 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 题目 B君和G君聊天的时候想到了如下的问题。 给定自然数l和r ,选取2个整数$x,y$满足$l int main() { int t; scanf("%d", &t); while (t ) { long long a, b, ans = 0; scanf("%lld%lld", &a, &b); 阅读全文
posted @ 2020-05-06 20:00 YouXam 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 题目 一个长度为n的大数,用$S_1,S_2,S_3...S_n$表示,其中$S_i$表示数的第$i$位,$S_1$是数的最高位,告诉你一些限制条件,每个条 件表示为四个数,\(l_1,r_1,l_2,r_2\),即两个长度相同的区间,表示子串$S_,S_{l_1+1},S_{l_1+2}...S_ 阅读全文
posted @ 2020-05-03 23:10 YouXam 阅读(77) 评论(0) 推荐(0) 编辑
摘要: 题目 lxhgww最近迷上了一款游戏,在游戏里,他拥有很多的装备,每种装备都有2个属性,这些属性的值用[1,10000]之间的数表示。当他使用某种装备时,他只能使用该装备的某一个属性。并且每种装备最多只能使用一次。 游戏进行到最后,lxhgww遇到了终极boss,这个终极boss很奇怪,攻击他的装备 阅读全文
posted @ 2020-05-03 20:22 YouXam 阅读(256) 评论(0) 推荐(4) 编辑
摘要: "洛谷链接" 题目 Although Inzane successfully found his beloved bone, Zane, his owner, has yet to return. To search for Zane, he would need a lot of money, o 阅读全文
posted @ 2020-04-29 23:22 YouXam 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 题目 Farmer John正在一个新的销售区域对他的牛奶销售方案进行调查。他想把牛奶送到T个城镇 $(1 5,4 6和1 3,花费分别是 100, 100, 10。FJ的中心城镇在城镇4。 输出样例 样例输出解释 FJ的奶牛从4号城镇开始,可以通过道路到达3号城镇。然后他们会通过航线达到5和6号城 阅读全文
posted @ 2020-04-29 21:45 YouXam 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 题目 For their physical fitness program, $N (2 ≤ N ≤ 1,000,000)$ cows have decided to run a relay race using the $T (2 ≤ T ≤ 100)$ cow trails throughout 阅读全文
posted @ 2020-04-27 23:13 YouXam 阅读(223) 评论(1) 推荐(1) 编辑
摘要: The only difference between the easy and the hard versions is the maximum value of $k$. You are given an infinite sequence of form "112123123412345…" 阅读全文
posted @ 2020-04-27 21:13 YouXam 阅读(239) 评论(0) 推荐(2) 编辑
摘要: 题目 米特是D星球上一种非常神秘的物质,蕴含着巨大的能量。在以米特为主要能源的D星上,这种米特能源的运输和储存一直是一个大问题。D星上有N个城市,我们将其顺序编号为1到N,1号城市为首都。这N个城市由N 1条单向高速通道连接起来,构成一棵以1号城市(首部)为根的树,高速通道的方向由树中的儿子指向父亲 阅读全文
posted @ 2020-04-25 23:22 YouXam 阅读(120) 评论(0) 推荐(1) 编辑
摘要: 题目 Given a list of N integers with absolute values no larger than $10^{15}$, find a non empty subset of these numbers which minimizes the absolute val 阅读全文
posted @ 2020-04-25 21:11 YouXam 阅读(166) 评论(0) 推荐(2) 编辑
摘要: 题目 Z 国的骑士团是一个很有势力的组织,帮会中汇聚了来自各地的精英。他们劫富济贫,惩恶扬善,受到社会各界的赞扬。 最近发生了一件可怕的事情,邪恶的 Y 国发动了一场针对 Z 国的侵略战争。战火绵延五百里,在和平环境中安逸了数百年的 Z 国又怎能抵挡的住 Y 国的军队。于是人们把所有的希望都寄托在了 阅读全文
posted @ 2020-04-23 22:01 YouXam 阅读(143) 评论(0) 推荐(0) 编辑