09 2018 档案
摘要:小w不会离散数学,所以她van的图论游戏是送分的小w有一张n个点n-1条边的无向联通图,每个点编号为1~n,每条边都有一个长度小w现在在点x上她想知道从点x出发经过每个点至少一次,最少需要走多少路输入描述:第一行两个整数 n,x,代表点数,和小w所处的位置第二到第n行...
阅读全文
摘要:第一种方法:暴力求解long long C[70][70];void pre(){ memset(C,0,sizeof(C)); for(int i=0;i<70;i++) for(int j=0;j<=i;j++) C...
阅读全文
摘要:彻底入门模板如下:int lowb(int t){ return t & (-t);}void add(int i,int v){ for( ;i 0;s += ar[i],i -= lowb(i)); return s;}例题:ACM-ICPC ...
阅读全文
摘要:基础模板:#include#include#includeusing namespace std;const int inf = 0x3f3f3f3f;const int maxn = 1010;int n,m,x,ct;int g[maxn][maxn],gr[ma...
阅读全文
摘要:A prime number (or a prime) is a natural number greater than 111 that cannot be formed by multiplying two smaller natural numbers. Now lets define a n
阅读全文
摘要:51nod 1089 最长回文子串 V2(Manacher算法) 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题回文串是指aba、abba、cccbccc、aaaa这种左右对称的字符串。输入一个字符串Str,输出Str里最长回文子串的长度...
阅读全文

浙公网安备 33010602011771号