题意:给定n个数字,第i个为a[i],求使得sigma k-a[i]>sigma a[i]最小的k

n,a[i]<=1e2

思路:

 #include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<map>
#include<queue>
#include<vector>
#include<ctime>
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef vector<int> VI;
#define fi first
#define se second
#define MP make_pair
#define N 210000
#define M 130
#define MOD 1000000007
#define eps 1e-8
#define pi acos(-1) int main()
{
int n;
scanf("%d",&n);
int s=;
int mx=;
for(int i=;i<=n;i++)
{
int x;
scanf("%d",&x);
s+=x;
mx=max(mx,x);
}
int ans=*s/n;
if(ans*n<=*s) ans++;
ans=max(ans,mx);
printf("%d\n",ans);
return ;
}

最新文章

  1. JSON Web Token实际应用
  2. &lt;&lt;&lt; html图片背景平铺
  3. lstm
  4. Rshare Pro是否可以放入至客户企业App Store?
  5. javascript 打开新窗口(window.open)
  6. Parallelogram Counting(平行四边形个数,思维转化)
  7. jquery 工作笔记,不断整理中..
  8. Linux中处理需要传输的IP报文流程
  9. Http请求工具实例编写(超长,比较清楚)
  10. isinstance使用方法
  11. 服务器Nginx 反向代理 其他服务器 8181端口 失败的问题
  12. c# List列表数据转换成树形结构
  13. 搭建自己的hexo博客
  14. 取消win10 任务栏已固定的软件
  15. 阿里启动新项目:Nacos,比 Eureka 更强!
  16. Android开发 ---代码创建选项菜单、隐藏菜单项、菜单的生命周期,菜单按钮图标设置、搜索框、xml中设置子菜单
  17. pycharm如何新项目如何不默认创建虚拟环境(吐槽)
  18. yolov2源码分析
  19. vux icon
  20. 差异表达分析之FDR

热门文章

  1. STL之deque用法
  2. centos7中使用LVM管理磁盘和挂载磁盘
  3. MySQL主从复制原理及配置过程
  4. tcl之list操作-llength/lindex/lrange/linsert/lreplace
  5. P1605迷宫
  6. 《鸟哥的Linux私房菜》学习笔记(5)——权限管理
  7. RCP 主题切换
  8. 3 View - Response对象
  9. 03017_ajax
  10. 赢友网络通用框架V10.0.0(WinuAppSoft) 基础框架设计表