最小生成树View Code #include<iostream>#include<cstdio>#include<cstdlib>#include<cstring>usingnamespacestd;#definemaxn55#defineinf0x3f3f3f3fintn,m;intvis[maxn];intlowc[maxn];intcost[maxn][maxn];intprim(){inti,j,p;intminc,res=0;memset(vis,0,sizeof(vis));vis[0]=1;for(i=1;i<n;i++)l
转载 2011-07-14 10:21:00
34阅读
2评论
NetworkingTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 4457Accepted: 2421DescriptionYou are assigned to design network connections between certain points in a wide area. You are given a set of points in the area, and a set of possible routes for the cables that may connect pairs of point
原创 2021-07-29 16:20:36
105阅读
做完难的…… 再看这题就感觉特别水…… 注意...
转载 2016-02-20 04:26:00
62阅读
2011-12-27 15:16:26地址:http://acm.hdu.edu.cn/showproblem.php?pid=1287题意:这题的题意很让人莫名。其实是说存在一个大写字母x,然后让原文(都是大写字母)和x做xor后得到密文。现在给密文求原文。因为x不知道,所以枚举x。判断方法是判断是否解密出来的原文都在'A'-'Z'范围内。代码:# include <stdio.h>int num[10010] ;int n ;int test (int x){ int i ; for (i = 0 ; i < n ; i++) if ((n
转载 2012-01-06 23:56:00
43阅读
NetworkingTime Limit: 1000msMemory Limit: 10000KBThis problem will be judged on PKU. Original ID: 1287 64-bit integer IO format: %lld Ja...
转载 2015-03-12 21:24:00
61阅读
原创 2022-12-07 05:49:40
84阅读
:::---> a = b ^ c —-> c = a ^ b b = a ^ c,就是异或递推的关系。http://acm.hdu.edu.cn/showproblem.php?pid=1287V吗
原创 2021-08-01 14:15:27
109阅读
题目地址:点击打开链接 思路: 异或运算法则 1. a ^ b = b ^ a  2. a ^ b ^ c = a ^ (b ^ c) = (a ^ b) ^ c;  3. d = a ^ b ^ c  可以推出 a = d ^ b ^ c.  4. a ^ b ^ a = b. 异或还有逆运算 a^b=c,则a=b^c AC代码: #include int a[3
原创 2022-08-04 09:12:22
23阅读
最小生成树
原创 2023-02-17 08:55:06
43阅读
做完难的…… 再看这题就感觉特别水…… 注意...
转载 2016-02-20 04:26:00
60阅读
题目链接:http://acm.pku.edu.cn/JudgeOnline/problem?id=1287[代码]
原创 2021-08-04 16:14:08
59阅读
1287水DP 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 #define N 1402 9 int dp[N][N][4];10 char s[N][N];11 int main()12 {13 int i,j,n;14 scanf("%d",&n);15 for(i = 0 ; i >s[i];17 dp[0][0][0] = 1;18 dp[0][n-1][3] = 1;19 for(i = 0 ; i...
转载 2013-10-20 20:35:00
62阅读
2评论
题目链接:http://acm.pku.edu.cn/JudgeOnline/problem?id=1287   #include <iostream>  #include <limits>  using namespace std;   const int M
原创 2009-09-12 14:31:00
342阅读
思路:最小生成树模板题#include #include #include #include #include #include #include #include #include #include #include #include # maxn 1000#define LL lon
原创 2023-06-12 14:12:53
50阅读
Prim最小生成树
转载 2016-09-12 15:55:00
30阅读
2评论
大意:
原创 2022-10-14 15:04:49
31阅读
                                 &n
原创 2013-06-30 16:31:00
405阅读
题意: 破译密码 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3227 Accepte...
转载 2014-03-30 12:49:00
99阅读
2评论
题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1287题意:给定一个n个点的无向图(0到n-1),你开始在0。你开始遍历这个图,每个点只能被...
转载 2019-01-08 08:26:00
158阅读
2评论
http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1287 简单的线段树题目,直接写个二分查找大于等于x的最小位置就好了。
转载 2017-08-21 19:21:00
147阅读
2评论
  • 1
  • 2
  • 3
  • 4
  • 5