随笔分类 -  oi

摘要:并查集简介 并查集是一个树形的数据结构,能够实现以下功能: 将两个节点所属的两个集合合并 查询两个节点是否在一个集合里 并查集教学 我们以洛谷的并查集板题为例 P3367 【模板】并查集 首先我们有$n$个节点。 因为是树形结构,所以我们用$f[x]$记录节点$x$的父亲节点。 当我们把两个节点$x 阅读全文
posted @ 2022-11-20 20:24 oblivionl 阅读(62) 评论(0) 推荐(0)
摘要:题目链接 K.复合函数 输入文件: standard input 输出文件: standard output 时间限制: 1 second 空间限制: 512 megabytes 给定正整数$n$,并记$I_n={1,2,\cdots,n}$。 给定一个定义在$I_n$上的函数$f$,满足对于任意$ 阅读全文
posted @ 2022-10-16 21:26 oblivionl 阅读(148) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2020-11-01 13:10 oblivionl 阅读(5) 评论(0) 推荐(0)
摘要:题目链接 Bridges 题目描述 An edge in an undirected graph is a bridgeif after removing it the graph will be disconnected. Given an undirected connected graph, 阅读全文
posted @ 2020-08-11 20:41 oblivionl 阅读(131) 评论(0) 推荐(0)
摘要:题目链接 MEX Queries 题目描述 You are given a set of integer numbers, initially it is empty. You should perform \(n\) queries. There are three different types 阅读全文
posted @ 2020-08-11 19:03 oblivionl 阅读(191) 评论(0) 推荐(0)
摘要:题目链接 Intervals 题目描述 You are given \(n\) closed, integer intervals \([a_i,b_i]\) and \(n\) integers \(c_1\), ...,\(c_n\). Write a program that: reads t 阅读全文
posted @ 2020-08-11 18:34 oblivionl 阅读(139) 评论(0) 推荐(0)
摘要:题目链接 Sightseeing trip 题目描述 There is a travel agency in Adelton town on Zanzibar island. It has decided to offer its clients, besides many other attrac 阅读全文
posted @ 2020-08-11 18:33 oblivionl 阅读(160) 评论(0) 推荐(0)
摘要:题目链接 Non-trivial Common Divisor 题目描述 You are given a positive integer sequence \(A\) of length \(N\). You can remove any numbers from the sequence to 阅读全文
posted @ 2020-08-11 18:32 oblivionl 阅读(229) 评论(0) 推荐(0)
摘要:题目链接 Patches 题目描述 Carlos is very concerned with the environment. Whenever possible, he tries to use less pollutingmeans of transport. He recently got 阅读全文
posted @ 2020-08-11 18:31 oblivionl 阅读(159) 评论(0) 推荐(0)
摘要:题目链接 Naptime 题目描述 Goneril is a very sleep-deprived cow. Her day is partitioned into \(N\) ($3 \le N \le 3,830$) equal time periods but she can spend o 阅读全文
posted @ 2020-08-11 18:29 oblivionl 阅读(177) 评论(0) 推荐(0)
摘要:题目链接 Choosing Capital for Treeland 题目描述 The country Treeland consists of n cities, some pairs of them are connected with unidirectional roads. Overall 阅读全文
posted @ 2020-08-11 18:28 oblivionl 阅读(141) 评论(0) 推荐(0)
摘要:题目链接 Binary Apple Tree 题目描述 Let's imagine how apple tree looks in binary computer world. You're right, it looks just like a binary tree, i.e. any bipa 阅读全文
posted @ 2020-08-11 18:27 oblivionl 阅读(184) 评论(0) 推荐(1)
摘要:题目链接 Anniversary Party 题目背景 The president of the Ural State University is going to make an 80'th Anniversary party. The university has a hierarchical 阅读全文
posted @ 2020-08-11 18:25 oblivionl 阅读(147) 评论(0) 推荐(0)
摘要:题目链接 Longge's problem 题目描述 Longge is good at mathematics and he likes to think about hard mathematical problems which will be solved by some graceful 阅读全文
posted @ 2020-08-11 18:24 oblivionl 阅读(158) 评论(0) 推荐(0)
摘要:题目链接 Farey Sequence 题目描述 The Farey Sequence Fn for any integer \(n\) with \(n \ge 2\) is the set of irreducible rational numbers \(a/b\) with $0 < a < 阅读全文
posted @ 2020-08-11 18:22 oblivionl 阅读(128) 评论(0) 推荐(0)
摘要:题目链接 How many ways?? 题目描述 春天到了, HDU校园里开满了花, 姹紫嫣红, 非常美丽. 葱头是个爱花的人, 看着校花校草竞相开放, 漫步校园, 心情也变得舒畅. 为了多看看这迷人的校园, 葱头决定, 每次上课都走不同的路线去教室, 但是由于时间问题, 每次只能经过$k$个地方 阅读全文
posted @ 2020-08-11 18:20 oblivionl 阅读(97) 评论(0) 推荐(0)
摘要:题目链接 随机数生成器 题目描述 栋栋最近迷上了随机算法,而随机数生成是随机算法的基础。栋栋准备使用线性同余法(Linear Congruential Method)来生成一个随机数列,这种方法需要设置四个非负整数参数$m$,\(a\),\(c\),\(X_0\),按照下面的公式生成出一系列随机数 阅读全文
posted @ 2020-08-11 18:19 oblivionl 阅读(174) 评论(0) 推荐(0)
摘要:题目链接 Another kind of Fibonacci 题目描述 As we all known , the Fibonacci series : \(F\)($0$)\(=1\),\(F\)($1$)\(=1\),\(F\)(\(N\))\(=F\)(\(N-1\))\(+F\)(\(N-2 阅读全文
posted @ 2020-08-11 18:18 oblivionl 阅读(123) 评论(0) 推荐(0)
摘要:题目链接 Queuing 题目描述 Queues and Priority Queues are data structures which are known to most computer scientists. The Queue occurs often in our daily life 阅读全文
posted @ 2020-08-11 18:17 oblivionl 阅读(172) 评论(0) 推荐(0)
摘要:题目链接 A Simple Math Problem 题目描述 Lele now is thinking about a simple function f(x). If x < 10 f(x) = x. If x >= 10 f(x) = a0$\(f(x-1)+a1\)\(f(x-2)+a2\) 阅读全文
posted @ 2020-08-11 18:16 oblivionl 阅读(108) 评论(0) 推荐(0)