05 2020 档案
摘要:题目 有这样一个有关最大公约数的函数: 函数 f(x, y): { c=0 当 y>0: { c +=1 t = x % y x = y y = t } 返回 c * x * x } 给出三个正整数n,m,p,你需要计算: \(\sum_{i=1}^{n}\sum_{j=1}^{m} \lfloor
阅读全文
摘要:题目 波雷卡普和瓦西里喜欢简单的逻辑游戏。今天他们玩了一个游戏,这个游戏在一个很大的棋盘上进行,他们每个人有一个棋子。他们轮流移动自己的棋子,波雷卡普先开始。每一步移动中,波雷卡普可以将他的棋子从(x,y) 移动到 (x-1,y) 或者 (x,y-1)。而瓦西里可以将他的棋子从(x,y) 移动到 (
阅读全文
摘要:题目 Musicians of a popular band "Flayer" have announced that they are going to "make their exit" with a world tour. Of course, they will visit Berland
阅读全文
摘要:题目 小豆现在有一个数 \(x\) ,初始值为 $1$ 。 小豆有 \(Q\) 次操作,操作有两种类型: \(m\): \(x=x×m\),输出 \(x\mod M\) ; \(pos\): \(x=x/\) 第 \(pos\) 次操作所乘的数(保证第 \(pos\) 次操作一定为类型 $1$,对于
阅读全文
摘要:题目 Tour operator Your Personal Holiday organises guided bus trips across the Benelux. Every day the bus moves from one city S to another city F. On th
阅读全文
摘要:题目 For a given positive integer n, please find the saallest positive integer x that we can find an integer y such that $y^2 = n +x^2$. 输入 The first li
阅读全文
摘要:题目 小铭铭最近获得了一副新的桌游,游戏中需要用 $m$ 个骑士攻占 $n$ 个城池。这 $n$ 个城池用 $1$ 到 $n$ 的整数表示。除 $1$ 号城池外,城池 $i$ 会受到另一座城池 $f_i$ 的管辖,其中 $f_i using namespace std; const int N =
阅读全文
摘要:题目 我们称一个有向图G是 传递的,当且仅当对任意三个不同的顶点a,,若G中有 一条边从a到b且有一条边从b到c ,则G中同样有一条边从a到c。 我们称图G是一个 竞赛图,当且仅当它是一个有向图且它的基图是完全图。换句 话说,将完全图每条边定向将得到一个竞赛图。 下图展示的是一个有4个顶点的竞赛图。
阅读全文
摘要:题目 春天到了, HDU校园里开满了花, 姹紫嫣红, 非常美丽. 葱头是个爱花的人, 看着校花校草竞相开放, 漫步校园, 心情也变得舒畅. 为了多看看这迷人的校园, 葱头决定, 每次上课都走不同的路线去教室, 但是由于时间问题, 每次只能经过k个地方, 比方说, 这次葱头决定经过$2$个地方, 那他
阅读全文
摘要:题目 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
阅读全文
摘要:题目 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
阅读全文
摘要:# 题目 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
阅读全文
摘要:题目 为了使得大家高兴,小Q特意出个自认为的简单题(easy)来满足大家,这道简单题是描述如下: 有一个数列A已知对于所有的$A[i]$都是1~n的自然数,并且知道对于一些$A[i]$不能取哪些值,我们定义一个数列的积为该数列所有元素的乘积,要求你求出所有可能的数列的积的和 $mod 1000000
阅读全文
摘要:题目 这是一个简单的游戏,在一个n n的矩阵中,找n个数使得这n个数都在不同的行和列里并且要求这n个数中的最大值和最小值的差值最小。 输入格式 输入一个整数$T$表示$T$组数据。 对于每组数据第一行输入一个正整数$n(1 define inf 0x3f3f3f3f using namespace
阅读全文
摘要:题目 题解 其实就是一个KM的板子 KM算法在进行中, 需要满足两个点的顶标值之和大于等于两点之间的边权, 所以进行一次KM即可. KM之后, 顶标之和就是最小的。因为如果不是最小的,就能通过修改顶标值来使某对顶点的顶标值满足$wx[i]+ly[j]==w[i][j]$,这样相等子图中又会多一条边,
阅读全文
摘要:题目 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
阅读全文
摘要:题目 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
阅读全文
摘要:题目 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
阅读全文
摘要:题目 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
阅读全文
摘要:题目 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);
阅读全文
摘要:题目 一个长度为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_
阅读全文
摘要:题目 lxhgww最近迷上了一款游戏,在游戏里,他拥有很多的装备,每种装备都有2个属性,这些属性的值用[1,10000]之间的数表示。当他使用某种装备时,他只能使用该装备的某一个属性。并且每种装备最多只能使用一次。 游戏进行到最后,lxhgww遇到了终极boss,这个终极boss很奇怪,攻击他的装备
阅读全文

浙公网安备 33010602011771号