题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4759 题意:有一堆2^n的牌,牌原先按(1,2,....k)排序,每一次洗牌都将牌分成两种情况:(1,3,5,....k-1)或(2,4,6,.....k), 给出四个数:A X B Y ,问有没有可能出现A位置的牌序号为X,B位置的牌序号是Y.输出Yes或No. 1 <= N <= 1000, 1 <= A, B, X, Y <= 2^N. 分析:二进制的运用. 题目给的牌编…
Problem Description In Land waterless, water is a very limited resource. People always fight for the biggest source of water. Given a sequence of water sources with a1,a2,a3,...,an representing the size of the water source. Given a set of queries eac…
Problem Description On the way to the next secret treasure hiding place, the mathematician discovered a cave unknown to the map. The mathematician entered the cave because it is there. Somewhere deep in the cave, she found a treasure chest with a com…
Travel Time Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2404 Accepted Submission(s): 842 Problem Description Jack likes to travel around the world, but he doesn’t like to wait. Now, he is tr…
Count The Pairs Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 277 Accepted Submission(s): 150 Problem Description With the 60th anniversary celebration of Nanjing University of Science…
Constructing Roads Time Limit: 2000MS Memory Limit: 65536K Description There are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say two village A…
How Many Tables Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem Description Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at…
春训团队赛第四场 ID A B C D E F G H I J K L M AC O O O O O O O O O 补题 ? ? O O 传送门 题目链接(CF Gym102021) 题解链接(pdf) 代码 & 简易题解 [A]:LCA 给定一个格状迷宫,保证任意点均可达,且任意两格点间有且仅有一条简单路径. 给定一组移动序列,求按照这个序列走的累计路程. 按照题意对图预处理,得到一棵树,对于每对询问求 \(\text{LCA}\) 的同时求距离,累加即为答案. 一开始 \(\text{RE…
date: 2018-11-25 08:31:30 updated: 2018-11-25 08:31:30 栈&队列&并查集&哈希表(julyedu网课整理) 栈和队列 1.定义 存放数据的线性表 操作:入栈/队列.出栈/队列.判断满/空 空间复杂度:O(n) 单次操作时间复杂度:O(1) 区别 先进后出(FILO, First In Last Out) 先进先出(FIFO, First In First Out) 2.实现 数组和链表皆可(线性表) 指针(辅助变量) 栈顶/底指…