摘要:题目链接:http://codeforces.com/contest/828/problem/C C. String Reconstruction time limit per test 2 seconds memory limit per test 256 megabytes input stan
阅读全文
摘要:题目链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1515 1515 明辨是非 题目来源: 原创 基准时间限制:1 秒 空间限制:131072 KB 分值: 160 难度:6级算法题 收藏 关注 1515 明辨是非
阅读全文
摘要:一.题目类型: 1.普通并查集: poj2513 Colored Sticks hdu1198 Farm Irrigation SCAU 1138 代码等式 Gym - 100676F Palindrome Codeforces Round #363 (Div. 2) D. Fix a Tree C
阅读全文
摘要:题目链接:http://poj.org/problem?id=1417 True Liars Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 3851 Accepted: 1261 Description After having
阅读全文
摘要:题目链接:https://vjudge.net/problem/ZOJ-3261 In order to strengthen the defense ability, many stars in galaxy allied together and built many bidirectional
阅读全文
摘要:题目链接:http://poj.org/problem?id=1733 Parity game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9806 Accepted: 3795 Description Now and the
阅读全文
摘要:题目链接:http://poj.org/problem?id=1984 Navigation Nightmare Time Limit: 2000MS Memory Limit: 30000K Total Submissions: 7136 Accepted: 2556 Case Time Limi
阅读全文
摘要:题目链接:http://poj.org/problem?id=2912 Rochambeau Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 3663 Accepted: 1285 Description N children a
阅读全文
摘要:题目链接:http://poj.org/problem?id=1456 Supermarket Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 13736 Accepted: 6206 Description A supermar
阅读全文
摘要:题目链接:http://poj.org/problem?id=2492 A Bug's Life Time Limit: 10000MS Memory Limit: 65536K Total Submissions: 39415 Accepted: 12835 Description Backgro
阅读全文
摘要:题目链接:http://poj.org/problem?id=1182 食物链 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 78133 Accepted: 23275 Description 动物王国中有三类动物A,B,C,这
阅读全文
摘要:题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=3038 How Many Answers Are Wrong Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768
阅读全文
摘要:题目链接:http://codeforces.com/contest/731/problem/C 题解: 1.看题目时,大概知道,不同的袜子会因为要在同一天穿而差生了关联(或者叫相互制约), 其中一条袜子可以穿多次或者不穿。那么自然就想到用并查集(DSU), 把有关联的袜子放在一个集合(经过处理后,
阅读全文
摘要:题目链接:http://codeforces.com/contest/699/problem/D D. Fix a Tree time limit per test 2 seconds memory limit per test 256 megabytes input standard input
阅读全文
摘要:题目链接:https://vjudge.net/contest/155789#problem/E 题解: 由于是回文串,所以可以先将在对称位置的字符放在同一个集合(如果期间有两个非‘?’,且不相等,则退出操作。并跳过之后的某些步骤。注意输入不能跳过)。然后再接收输入的限制条件,进行并查集。有两种并查
阅读全文
摘要:1138 代码等式[附加题] 该题有题解 时间限制:500MS 内存限制:65536K 提交次数:59 通过次数:21 题型: 编程题 语言: G++;GCC Description 输入格式 第一行数N为变量个数; 第二行N个数,为每个变量的位数 第三行为一个等式 输入格式 输出格式 输出解的个数
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1198 dfs: 1 #include<cstdio>//hdu1198 dfs 2 #include<cstring> 3 4 int well[11][5] = { {1,1,1,0,0},{1,0,
阅读全文
摘要:题目链接:http://poj.org/problem?id=2513 题解:通过这题了解了字典树。用字典树存储颜色,并给颜色编上序号。这题为典型的欧拉回路问题:将每种颜色当成一个点。首先通过并查集判断是否为连通图,再检验是否符合欧拉回路的特点。不过题目有一点很奇怪,在并查集中,若图为连通,不是有且
阅读全文