上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 42 下一页
摘要: 为什么暴力过不了这题。。。AC代码View Code 1 #include<stdio.h> 2 #include<string.h> 3 #include<stdlib.h> 4 struct tree{ 5 int lev; 6 tree* next[2]; 7 }; 8 tree root; 9 10 void build( char str[] ){11 int len = strlen( str );12 tree *p = &root;13 tree *tmp;14 for( int i=0;i<len;i++ ){15 ... 阅读全文
posted @ 2013-05-04 16:52 xxx0624 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 水题不解释。。。View Code 1 /* 2 简单题 3 */ 4 #include<stdio.h> 5 #include<string.h> 6 #include<stdlib.h> 7 #include<algorithm> 8 #include<iostream> 9 #include<queue>10 #include<vector>11 #include<map>12 #include<math.h>13 typedef long long ll;14 //typedef 阅读全文
posted @ 2013-05-04 16:51 xxx0624 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 最小生成树。。。。View Code 1 /* 2 prim 3 */ 4 #include<stdio.h> 5 #include<string.h> 6 #include<stdlib.h> 7 #include<algorithm> 8 #include<iostream> 9 #include<queue>10 #include<vector>11 #include<map>12 #include<math.h>13 typedef long long ll;14 //typed 阅读全文
posted @ 2013-05-04 16:49 xxx0624 阅读(265) 评论(0) 推荐(0) 编辑
摘要: View Code 1 #include<stdio.h> 2 const int maxn = 105; 3 int sum[ maxn ],num[ maxn ],p[ maxn ]; 4 int dp[ maxn ]; 5 int min( int i,int j ) { 6 return i>j?j:i; 7 } 8 int main(){ 9 int ca;10 scanf("%d",&ca);11 while( ca-- ){12 int n;13 scanf("%d",&n);14 sum[ 0 ]... 阅读全文
posted @ 2013-05-04 16:48 xxx0624 阅读(220) 评论(2) 推荐(0) 编辑
摘要: 找规律题。只要分析到4步的时候差不多规律就出来了。其次就是大整数!!!!!!!!!View Code 1 import java.util.*; 2 import java.math.*; 3 import java.text.*; 4 import java.io.* ; 5 6 public class Main{ 7 public static void main( String args[] ){ 8 Scanner cin = new Scanner(new BufferedInputStream(System.in)); 9 BigIn... 阅读全文
posted @ 2013-05-03 15:41 xxx0624 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 唉。。看题解过的。。。View Code 1 /* 2 题意: 3 给定n个人,求组队的方法数。 4 关键:首先要分情况,1个队,2个队,3个队。。。 5 递推: 6 a[ i ][ j ]:前i个人分成j个队的方法数。 7 a[i][j] = a[i-1][j-1](第i个人自成一队)+a[i-1][j]*j(第i个人加入了j个队中的某个队); 8 */ 9 #include<stdio.h>10 #include<string.h>11 #include<stdlib.h>12 #include<algorithm>13 #include&l 阅读全文
posted @ 2013-05-03 15:04 xxx0624 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 为什么不会有多个答案。。。求解释。。。View Code 1 /* 2 异或运算 3 a^b^b = a; 4 1. a ^ b = b ^ a 5 2. a ^ b ^ c = a ^ (b ^ c) = (a ^ b) ^ c; 6 3. d = a ^ b ^ c 可以推出 a = d ^ b ^ c. 7 4. a ^ b ^ a = b 8 9 枚举res的时候,为什么不可能出现多个满足题意的答案?10 11 */12 #include<stdio.h>13 #include<string.h>14 #include<stdlib.h>15 #in 阅读全文
posted @ 2013-04-27 20:30 xxx0624 阅读(240) 评论(0) 推荐(0) 编辑
摘要: View Code 1 /* 2 欧拉函数+求与之互素的数的个数 3 */ 4 #include<stdio.h> 5 #include<string.h> 6 #include<stdlib.h> 7 #include<algorithm> 8 #include<iostream> 9 #include<queue>10 #include<vector>11 #include<map>12 #include<math.h>13 typedef long long ll;14 //typ 阅读全文
posted @ 2013-04-26 19:56 xxx0624 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 题意不难理解dp[ i ][ j ] = dp[ i-1 ][ j ]+dp[ i ][ j-1 ];View Code 1 /* 2 dp 3 */ 4 #include<stdio.h> 5 #include<string.h> 6 const int maxn = 1005; 7 int dp[ maxn ][ maxn ]; 8 int mat[ maxn ][ maxn ]; 9 int main(){10 int ca;11 scanf("%d",&ca);12 while( ca-- ){13 int n,m;14 sca... 阅读全文
posted @ 2013-04-26 19:08 xxx0624 阅读(380) 评论(0) 推荐(0) 编辑
摘要: 给n个矩阵,求出相乘后的结果View Code 1 #include<stdio.h> 2 const int maxn = 105; 3 struct node{ 4 int row,col; 5 int mat[ maxn ][ maxn ]; 6 }; 7 node res; 8 int main(){ 9 int ca;10 scanf("%d",&ca);11 while( ca-- ){12 int x;13 scanf("%d",&x);14 node a,b;15 int ... 阅读全文
posted @ 2013-04-26 19:05 xxx0624 阅读(223) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 42 下一页