2011年5月4日

单词数

摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>char ch[110000];char sh[100000][120];int visit[10000];int main( ){ int i,j,k,t,len,flag; while(gets(ch)&&ch[0]!='#') { flag=1; len=strlen(ch); t=0,... 阅读全文

posted @ 2011-05-04 10:39 more think, more gains 阅读(153) 评论(0) 推荐(0) 编辑

不要62

摘要: 这道题数据量有点大,首先要预处理,否则会超时。 #include<stdio.h>#include<string.h>#include<stdlib.h>int A[1000010];int fun(int x){ while(x) { if(x%10==4||x%100==62) return 1; x/=10; } return 0;}int main( ){ int M,N,i,j,t=0;... 阅读全文

posted @ 2011-05-04 08:49 more think, more gains 阅读(279) 评论(0) 推荐(0) 编辑

用qsort Design T-Shirt

摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>struct NODE{ int i; double sum;}T[100000];int m,n,k; int cmp1(const void *a,const void *b){ if( (*(NODE *)a).sum==(*(NODE *)b).sum) return (*(NODE ... 阅读全文

posted @ 2011-05-04 00:49 more think, more gains 阅读(123) 评论(0) 推荐(0) 编辑

Design T-Shirt

摘要: #include <stdio.h>#include <algorithm>using namespace std;struct Node{ int i; double sum;}T[10000];int n,m,k;bool cmp1(Node a,Node b){ if(a.sum== b.sum) return a.i < b.i; //值按降序,如果相等,标号按升序 return a.su... 阅读全文

posted @ 2011-05-04 00:30 more think, more gains 阅读(149) 评论(0) 推荐(0) 编辑

导航