zoukankan      html  css  js  c++  java
  • 就是过不了啊无奈。。。。。水题都过不了…………OTZ OTZ OTZ

    #include<stdio.h>
    main()
    {
    int i,l,n,m,q,p,y,I,sum,t,T;
    int x[2010];
    int z[2010];
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
    scanf("%d",&m);
    for(l=1;l<=m;l++)
    {
    scanf("%d",&x[l]);
    }y=1;
    for(p=1;p<=m;p++)
    {sum=0;
    for(q=p;q<=m;q++)
    {
    sum=sum+x[q];
    z[y]=sum;
    y++;
    }
    }
    sum=z[1];
    for(I=1;I<y;I++)
    {
    if(sum<z[I])
    {sum=z[I];l=I;
    }
    }
    t=m;
    T=0;
    while(l>0)
    {
    l=l-t;
    t=t-1;
    T++;
    }
    l=l+t;
    l=l+T;
    if(sum==x[1]){T=1;l=1;}
    printf("Case %d:\n",i);
    printf("%d %d %d\n\n",sum,T,l);
    }}

    先记下来吧,哪天智商恢复了再去A掉。。。。 HDU  1003

  • 相关阅读:
    django学习笔记1
    排序多重排序
    06计算列
    填充日期序列
    行,列单元格
    读取excel文件
    监控文本
    天干地支纪年法
    Mysql基础
    JDBC基础
  • 原文地址:https://www.cnblogs.com/alexanderone/p/3845116.html
Copyright © 2011-2022 走看看