自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

acm_JL的博客

acm 进阶之路

  • 博客(16)
  • 收藏
  • 关注

原创 uva_10929

#include#includeusing namespace std;int main(){ string str; int i,a=0,b=0; while(cin>>str) { for(i=0;i<=str.length();i=i+2) a+=str[i]-'0'; for(i=1;i<=str.length();i=i+2) // str.length()

2015-12-13 22:06:38 532

原创 uva_10922

#include#includeusing namespace std;char str[100];int main() { int i,j,sum=0,deep=0; while(cin>>str) { sum=0; deep=0; if(strlen(str)==0||str[0]=='0') break; for(i=0;i<strlen(str);i+

2015-12-13 21:51:59 445

原创 poj_1019

//超时了 #includeusing namespace std;int len[1010];int main(){ int m,t,i,sum; cin>>m; for(i=1;i<=1000;i++) len[i]=i; while(m--) { cin>>t; sum=0; i=1; while(sum<t) { sum+=len[i];

2015-12-13 21:14:09 306

原创 poj_1833

#include #include #include using namespace std;int num[1024];int main(){    int cas,n,k,i,j;    scanf("%d",&cas);    while(cas--)    {        scanf("%d%d",&n,&k);        for(i=

2015-12-13 20:59:15 455

原创 poj_1338

对于每一个质数2 3 5,我们都要找到对应的之前已经计算出的最小的丑数使之乘以这个质数后大于当前的丑数,然后再从这三个里取最小的那个,我们记录三个数a2,a3,a5,分别保存对应的质数计算到哪个下标了,然后更新所有质数对应的下标,使之乘积大于当前的丑数#include using namespace std;const int M=1501;int ans[M];int getMin(in

2015-12-13 20:40:29 358

原创 poj_2136

#include #include #include #include using namespace std;int main(){ int len,i,j,maxhigh=0; string s; int c[26]; memset(c,0,sizeof(c)); while (cin>>s) { len=s.length(); for(i=0;i<len;i+

2015-12-13 20:32:15 499

原创 poj_2242

#include #include #include #include #include #include using namespace std;#define clc(s,t) memset(s,t,sizeof(s))#define PI 3.141592653589793double dis(double a,double b,double c,double d){

2015-12-13 20:13:13 466

原创 poj_3006

#include#includeusing namespace std;bool isPrime(int num){ if(num<2){ return false; } for(int i=2;i<=sqrt(1.0*num);i++){ if(num%i==0){ return false; } } return true;}int main(int a

2015-12-13 20:07:13 331

原创 poj-1581

#include #include #include #include //定义符号常量using namespace std;int main(){ int n,sub,time,firstsub,firsttime,i,j,k; string team,firstteam; cin>>n; firstsub=0; firsttime=INT_MAX;//定义在 #inc

2015-12-13 20:02:29 613

原创 poj_2196

#include using namespace std;int calc(int k, int b){ int result=0; while(k/b) { result+=(k%b); k/=b; } result+=(k%b); return result;}int main(){ int i; for(i=2992;i<=9999;i++) if((

2015-12-13 16:42:35 448

原创 poj_1005

#include#includeint num;float x,y;int i,year;double calc;int main(){ scanf("%d",&num); for(i=1;i<=num;i++) { scanf("%f %f ",&x,&y); calc=(x*x+y*y)*3.14/2/50; year=ceil(calc); //向上取整函数

2015-12-13 16:24:14 360

原创 poj_1003

#includeusing namespace std;const int maxn=300;const double delta=1e-8;int zero(double x){ if(x<-delta) return -1; return x>delta;}int main(){ double len[maxn]; int total; len[0]=0.0;

2015-12-13 16:23:45 377

原创 poj_2739

#includeusing namespace std;const int maxp=2000,n=10000;int prime[maxp],total=0,m;bool isprime(int k){ for(int i=0;i<total;i++) { if(k%prime[i]==0) return false; } return true;}int ma

2015-12-13 16:23:06 443

原创 uva-10921

#include#include#includeusing namespace std;char num[50]={'2','2','2','3','3','3','4','4','4','5','5','5','6','6','6','7','7','7','7','8','8','8','9','9','9','9'};//注意要加‘’ char s[100];int main()

2015-12-08 21:29:23 519

原创 poj_2664

主要还是看懂题意。3 2 //选择了3科,两个类别0123 9876 2222 //选择的3科科目号2 1 8888 2222 //2表示在这个类别里共有两科8888和2222,最少要选择一个3 2 9876 2222 7654

2015-12-07 01:06:29 418

原创 poj_2339

解题思路:利用两个矩阵,一个存储昨天,一个存储今天。当昨天的S旁边为P的时候,就在今天的矩阵中将P改成S,其他情况,依次类推。注意的是每更新一次就要把更新后的矩阵当做昨天的矩阵,然后赋值给今天,在进行新的循环/*strcpy和memcpy主要有以下3方面的区别。1、复制的内容不同。strcpy只能复制字符串,而memcpy可以复制任意内容,例如字符数组、整型、结构体、类等。2

2015-12-07 00:53:32 771

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除