随笔分类 -  图论

摘要:【链接】 "我是链接,点我呀:)" 【题意】 让你求出桥的个数 【题解】 删掉这条边,然后看看1能不能到达其他所有的点就可以了 【代码】 cpp include using namespace std; const int M = 50; int n, m,g[M+10][M+10]; pair a 阅读全文
posted @ 2017-10-15 07:12 AWCXV 阅读(212) 评论(0) 推荐(0)
摘要:Time limit: 2 seconds Memory limit: 1024 megabytesIn ICPCCamp, there are n cities and m (bidirectional) roads between cities. The i-th road is... 阅读全文
posted @ 2017-10-06 19:23 AWCXV 阅读(144) 评论(0) 推荐(0)
摘要:time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output Recently Irina arrived to one of the... 阅读全文
posted @ 2017-10-06 19:23 AWCXV 阅读(160) 评论(0) 推荐(0)
摘要:Time Limit: 4 Sec Memory Limit: 64 MBSubmit: 1041 Solved: 415[Submit][Status][Discuss]Description最近,Elaxia和w**的关系特别好,他们很想整天在一起,但是大学的学习太紧张了,他们 必须合理地安... 阅读全文
posted @ 2017-10-06 19:23 AWCXV 阅读(81) 评论(0) 推荐(0)
摘要:Time Limit: 1 secondMemory Limit: 128 MB【问题描述】弗洛伊德是一个大牛!给一个有向图G,他有n个结点,现在请你求出对于他的每一对结点(x,y),从x出发走恰好k条边以后恰好到达结点y的路径条数。 【输入格式】输入文件第一行包含两个正整数n,k。(10 0 10... 阅读全文
posted @ 2017-10-06 19:23 AWCXV 阅读(134) 评论(0) 推荐(0)
摘要:Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 430 Accepted Submission(s): 181Problem Desc... 阅读全文
posted @ 2017-10-06 19:23 AWCXV 阅读(91) 评论(0) 推荐(0)
摘要:Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 2487 Accepted Submission(s): 386Problem D... 阅读全文
posted @ 2017-10-06 19:23 AWCXV 阅读(242) 评论(0) 推荐(0)
摘要:【问题描述】一个不同的值的升序排序数列指的是一个从左到右元素依次增大的序列,例如,一个有序的数列A,B,C,D 表示A#include int n, m, ru[27],dl[10000],head,tail,w[27][27];int main(){ memset(ru, 255, sizeof(... 阅读全文
posted @ 2017-10-06 19:23 AWCXV 阅读(240) 评论(0) 推荐(0)
摘要:Time Limit: 1 secondMemory Limit: 128 MB【问题描述】给定n个各不相同的无序字母对(区分大小写,无序即字母对中的两个字母可以位置颠倒)。请构造一个有n+1个字母的字符串使得每个字母对都在这个字符串中出现。【输入格式】第一行输入一个正整数n。 以下n行每行两个字母... 阅读全文
posted @ 2017-10-06 19:23 AWCXV 阅读(170) 评论(0) 推荐(0)
摘要:Time Limit: 20 secondMemory Limit: 20 MB问题描述数学家欧拉曾经解决过著名的七桥问题。下面写出七桥问题的描述:城市中有一条河,河中有 A、 D两个岛,河上有七座桥来连接两个岛及河的 B、 C两岸,问: ⑴能否刚好经过每座桥一次,既无重复也无遗漏? ⑵能否经过桥一... 阅读全文
posted @ 2017-10-06 19:23 AWCXV 阅读(203) 评论(0) 推荐(0)
摘要:time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output The map of Berland is a rectangle of... 阅读全文
posted @ 2017-10-06 19:23 AWCXV 阅读(124) 评论(0) 推荐(0)
摘要:Time Limit: 15 Sec Memory Limit: 162 MB Submit: 19227 Solved: 4726 [Submit][Status][Discuss] Description现在小朋友们最喜欢的”喜羊羊与灰太狼”,话说灰太狼抓羊不到,但抓兔子还是... 阅读全文
posted @ 2017-10-06 19:22 AWCXV 阅读(181) 评论(0) 推荐(0)
摘要:time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Student Vladislav came to his progra... 阅读全文
posted @ 2017-10-06 19:22 AWCXV 阅读(201) 评论(0) 推荐(0)
摘要:描述 在有向图 G 中,每条边的长度均为 1,现给定起点和终点,请你在图中找一条从起点到 终点的路径,该路径满足以下条件: 路径上的所有点的出边所指向的点都直接或间接与终点连通。 在满足条件 1 的情况下使路径最短。 注意:图 G 中可能存在重边和自环,题目保证终点没有出边。 请你输... 阅读全文
posted @ 2017-10-06 19:22 AWCXV 阅读(140) 评论(0) 推荐(0)
摘要:time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output A group of n cities is connected by ... 阅读全文
posted @ 2017-10-06 19:22 AWCXV 阅读(169) 评论(0) 推荐(0)
摘要:time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output Theseus has just arrived to Crete to... 阅读全文
posted @ 2017-10-06 19:22 AWCXV 阅读(162) 评论(0) 推荐(0)
摘要:time limit per test1.5 seconds memory limit per test256 megabytes inputstandard input outputstandard output Vanya is in the palace that can be... 阅读全文
posted @ 2017-10-06 19:22 AWCXV 阅读(197) 评论(0) 推荐(0)
摘要:time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output A tree is an undirected connected gr... 阅读全文
posted @ 2017-10-06 19:22 AWCXV 阅读(265) 评论(0) 推荐(1)
摘要:time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output ZS the Coder and Chris the Baboon ha... 阅读全文
posted @ 2017-10-06 19:22 AWCXV 阅读(140) 评论(0) 推荐(0)
摘要:【题目链接】:http://codeforces.com/contest/527/problem/D【题意】 一维线段上有n个点 每个点有坐标和权值两个域分别为xi,wi; 任意一对点(i,j) 如果|xi-xj|>=wi+wj 则在这两个点之间连一条边; 让你求最大团; 团就是任... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(218) 评论(0) 推荐(0)