随笔分类 -  图论

摘要:【题目链接】:http://www.lydsy.com/JudgeOnline/problem.php?id=1040【题意】 【题解】 题目相当于给你了若干个环(基本环->简单环); 然后每个环里面选一些点;相邻的点不能同时选; 先考虑只有一个环的情况 这样, 我们可以任意删掉一... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(96) 评论(0) 推荐(0)
摘要:【题目链接】:http://codeforces.com/contest/791/problem/B【题意】 给你m对朋友关系; 如果x-y是朋友,y-z是朋友 要求x-z也是朋友. 问你所给的图是否符合 【题解】 用并查集处理出每个朋友“团”的大小->就是连通块 然后这个连通块... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(183) 评论(0) 推荐(0)
摘要:【题目链接】:http://www.lydsy.com/JudgeOnline/problem.php?id=1027【题意】 【题解】 因为和为1; 所以只要知道两个属性第三个属性就能用1减出来了; 然后把每个合金材料化为平面坐标上的二维坐标; 两个合金能够合成的新合金的坐标就在... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(157) 评论(0) 推荐(0)
摘要:神经网络(NOIP2003第1题)Time Limit: 1 second Memory Limit: 50 MB【问题背景】 人工神经网络(Artificial Neural Network)是一种新兴的具有自我学习能力的计算系统,在模式识别、函数逼近及贷款风险评估等诸多领... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(146) 评论(0) 推荐(0)
摘要:Time Limit: 1 second Memory Limit: 128 MB【问题描述】路人丁成为了一名新公交车司机,每个司机都有一张牌子,牌子的正面写了拥有这个牌子的司机开的线路号,另外一面随便写了一 个号码。但是路人丁的牌子两面写的都不是自己开的线路号。所以他决定跟其他人换... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(251) 评论(0) 推荐(0)
摘要:Time Limit: 1 second Memory Limit: 32 MB【问题描述】邮局需要你来帮助他们为某个邮递员设计出一条能够穿过那遥远乡村的所有村子和小路至少一次的邮路(输入数据将会保证这么一条路是一定存在的)。但是,每条路线都是有一个花费的。各个村子里的村民希望邮递员... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(177) 评论(0) 推荐(0)
摘要:【题目链接】:http://www.lydsy.com/JudgeOnline/problem.php?id=1015【题意】 【题解】 /* 可以倒过来考虑; 相当于一个加入了一个节点; 然后问你联通块的数量; 可以记录所有节点有哪些边和它是连在一起的; ... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(102) 评论(0) 推荐(0)
摘要:【题目链接】:http://codeforces.com/contest/776/problem/D【题意】 每个门严格由两个开关控制; 按一下开关,这个开关所控制的门都会改变状态; 问你能不能使所有的门都打开(同时); 【题解】 /* 对于每个门, 有两个开关连接着它... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(280) 评论(0) 推荐(0)
摘要:【题目链接】:http://www.lydsy.com/JudgeOnline/problem.php?id=1006【题意】 【题解】 好难. 先去看《弦图与区间图》那篇论文吧; 链接:http://wenku.baidu.com/link?url=xPkoWrdBJLV-F4Q... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(112) 评论(0) 推荐(0)
摘要:Time Limit: 1 second Memory Limit: 256 MB【问题描述】N头牛要去参加一场在编号为X(1≤X≤n)的牛的农场举行的派对(1≤N≤1000),有M(1≤M≤100000)条有向道路,每条路长ti(1≤ti≤100);每头牛都必须参加完派对后回到家,... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(113) 评论(0) 推荐(0)
摘要:Time Limit: 1 second Memory Limit: 50 MB【问题描述】佳佳刚进高中,在军训的时候,由于佳佳吃苦耐劳,很快得到了教官的赏识,成为了“小教官”。在军训结束的那天晚上,佳佳被命令组织同学们进行篝火晚会。一共有n个同学,编号从1到n。一开始,同学们按照1... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(117) 评论(0) 推荐(0)
摘要:Time Limit: 1 second Memory Limit: 128 MB【问题描述】刷完牙洗完脸,黄黄同学就要上课去了。可是黄黄同学每次去上课时总喜欢把校园里面的每条路都走一遍,当然,黄黄同学想每条路也只走一遍。我们一般人很可能对一些地图是办不到每条路走一遍且仅走一遍的,但... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(163) 评论(0) 推荐(0)
摘要:time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Pavel cooks barbecue. There are n sk... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(159) 评论(0) 推荐(0)
摘要:time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output In the country there are n cities and... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(237) 评论(0) 推荐(0)
摘要:time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output The country Treeland consists of n c... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(195) 评论(0) 推荐(0)
摘要:time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output An undirected graph is called k-regu... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(213) 评论(0) 推荐(0)
摘要:time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Hongcow is ruler of the world. As ru... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(138) 评论(0) 推荐(0)
摘要:time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output After Vitaly was expelled from the un... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(318) 评论(0) 推荐(0)
摘要:Time Limit: 1 second Memory Limit: 128 MB【问题描述】病毒问题解决后,神牛们的心灵久久不能平静。他可以从一个程序联想到一些相似的程序。比如从程序1联想到2,从2联想到4,从4联想到6,从6联想到9……就像搜索一样一步一步越陷越深。不过同一种联想... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(116) 评论(0) 推荐(0)
摘要:【题目链接】:http://codeforces.com/problemset/problem/789/D【题意】 给你n个点,m条边; 可能会有自环 问你有没有经过某两条边各一次,然后剩余m-2条边,每条边各2次的 ... 阅读全文
posted @ 2017-10-04 18:44 AWCXV 阅读(183) 评论(0) 推荐(0)