摘要: View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<math.h> 4 #include<string.h> 5 6 int ascore, bscore; 7 8 int DFS(int m, int n, int p) 9 {10 if(ascore == 1) return 0; 11 if(m==1 && n==1)12 {13 bscore = 1;14 ascore = 1;15 return 0; 16 } ... 阅读全文
posted @ 2012-09-04 19:25 zhongya 阅读(379) 评论(0) 推荐(0) 编辑
摘要: View Code 1 import java.util.*; 2 import java.math.*; 3 import java.io.*; 4 5 public class Hdu1063{//提交时名字改为Main 6 public static void main(String args[]){ 7 int n; 8 BigDecimal R,res; 9 String str;10 Scanner cin = new Scanner(System.in);11 12 while(cin.hasNext()){13 ... 阅读全文
posted @ 2012-09-04 19:23 zhongya 阅读(343) 评论(0) 推荐(0) 编辑
摘要: View Code 1 import java.util.*; 2 import java.math.*; 3 import java.io.*; 4 5 public class Hdu1047{提交时要改为Main 6 public static void main(String args[]){ 7 int n, flag=0; 8 BigInteger a, sum; 9 10 Scanner cin = new Scanner (System.in);11 n = cin.nextInt();12 13 for(int ... 阅读全文
posted @ 2012-09-04 19:22 zhongya 阅读(136) 评论(0) 推荐(0) 编辑
摘要: View Code 1 import java.util.*; 2 import java.math.*; 3 import java.io.*; 4 5 public class Main{ 6 public static void main(String args[]){ 7 BigInteger f[] = new BigInteger[1005]; 8 int n, p; 9 Scanner cin = new Scanner(System.in);10 f[1] = BigInteger.valueOf(1);11 f[2] = BigInteg... 阅读全文
posted @ 2012-09-04 19:20 zhongya 阅读(164) 评论(0) 推荐(0) 编辑
摘要: View Code 1 import java.util.*; 2 import java.math.*; 3 import java.io.*; 4 5 public class Hdu1715{ 6 public static void main(String args[]){ 7 String s1; 8 BigDecimal a,b; 9 Scanner cin = new Scanner(System.in);10 11 while(cin.hasNext()){12 13 a = cin.nextBigDecim... 阅读全文
posted @ 2012-09-04 19:19 zhongya 阅读(159) 评论(0) 推荐(0) 编辑
摘要: View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<math.h> 4 #include<string.h> 5 6 char a[5002],b[4]="NOP"; 7 8 int ok(int l) 9 {10 int i, j;11 for(i = 0; i < (l+1)/2; i++) 12 {13 for(j = 0; j <= i; j++) 14 {15 if(a[l-i+j] != a[l-2*i+j-1])16 ... 阅读全文
posted @ 2012-09-02 22:32 zhongya 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 咋一看此题有点不知所措,后来看了别人的题解,感悟良多用你自己的四轮现在草稿纸上画画,边入栈边匹配,匹配则出栈,不匹配则入栈,如此下去。。。View Code 1 #include<cstdio> 2 #include<cstdlib> 3 #include<cmath> 4 #include<cstring> 5 #include<stack> 6 #include<iostream> 7 #include<string> 8 9 using namespace std;10 11 int i,j,k,ans; 阅读全文
posted @ 2012-09-02 22:28 zhongya 阅读(934) 评论(0) 推荐(0) 编辑
摘要: 题意是求七段数码管的显示,可将显示分为五个部分,垂直方向三个,水平方向两个;最后再求五个部分的组合。。。。好麻烦呐,不过思路简单,可能模拟题都这样吧。。。。View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<math.h> 4 #include<string.h> 5 6 void printv1(int s,int a) 7 { 8 int i; 9 printf(" "); 10 switch(a) 11 { 12 case 1: case 4: 13 阅读全文
posted @ 2012-08-28 23:09 zhongya 阅读(240) 评论(0) 推荐(0) 编辑
摘要: View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<string.h> 4 #include<math.h> 5 6 7 int main() 8 { 9 int i, t, j, m, ncases;10 int num, k, flag,a[18];11 12 while(scanf("%d",&num) != EOF)13 {14 if(num == 0) break;15 flag = 0;16 for(i=2; i<=16; ... 阅读全文
posted @ 2012-08-28 23:05 zhongya 阅读(218) 评论(0) 推荐(0) 编辑
摘要: View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<string.h> 4 5 typedef struct 6 { 7 int J, F; 8 double per; 9 }Point;10 Point P[1001];11 12 int cmp(const void *a,const void *b)13 {14 if((*(Point *)a).per < (*(Point *)b).per)15 return 1;16 else17 re... 阅读全文
posted @ 2012-08-21 10:41 zhongya 阅读(222) 评论(0) 推荐(0) 编辑