zoukankan      html  css  js  c++  java
  • 分组训练2

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3776

    第一题:很简单,但是还是WA了一次,以为粘贴复制省事,忘了改一个变量;所以卒;

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3782

    我们做的第二题,翻译错了题意,以为是输入字符串,想得太复杂了,浪费了太多的时间,最后队友很快打完了,才知道不是字符串,心累;

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3787

    做的第三题,没什么好说的,基本上一样的代码,队友没过,我却过了,很伤;

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3778

    第四题:想法题,队友过的; 

    4: #include <cstdio>

    #include <cstring>
    int main()
    {
     int t;
     int n,m;
     while(~scanf("%d",&t))
     {
      while(t--)
      {
       int di;
       int ma=0;
       int sum=0;
       scanf("%d%d",&n,&m);
       int i;
       for(i=0;i<n;i++)
       {
        scanf("%d",&di);
        if(ma<di)
        {
         ma=di;
        }
        sum+=di;
       }
       int ans=sum/m;
       if(sum%m)
       {
        ans++;
        
       }
       if(ans<ma)
       {
        ans=ma;
       }
       printf("%d ",ans);
      }
     }
     return 0;
    }

  • 相关阅读:
    Python基础编程常用模块汇总
    博客目录
    网络编程
    python 对象
    python模块和规范开发
    python常用内置函数
    python递归函数和匿名函数
    python装饰器
    python迭代器,生成器,推导式
    python作用域
  • 原文地址:https://www.cnblogs.com/gao-qi/p/6804471.html
Copyright © 2011-2022 走看看