ZOJ 3778Talented Chef
来源:互联网 发布:尼康固件 镜头数据 编辑:程序博客网 时间:2024/05/21 12:48
CodeForce上貌似有类似的题目 总和取商,有余数就加一,还要保证最大值不能超过答案
#include<iostream>#include<cstdio>#include<set>#include<string>#include<string.h>#include<cstring>#include<vector>#include<map>#include<queue>#include<stack>#include<cctype>#include<algorithm>#include<sstream>#include<utility>#include<cmath>#define mt(a) memset(a,0,sizeof (a))#define fl(a,b,c) fill(a,b,c)#define SWAP(a,b,t) (t=a,a=b,b=t)#define inf 1000000using namespace std;typedef long long ll;int main(){int T;cin >> T;while (T--){int n,m;scanf("%d %d", &n, &m);ll sum = 0, temp;int maxx = 0;for (int i = 0; i < n; i++){scanf("%lld", &temp);maxx = maxx>temp?maxx:temp;sum += temp;}ll ans = sum / m;if (sum%m)ans++;if (ans < maxx)ans = maxx;printf("%lld\n", ans);}return 0;}
0 0
- ZOJ 3778 Talented Chef
- 【zoj】 3778 Talented Chef
- zoj 3778 Talented Chef
- ZOJ 3778 Talented Chef
- zoj 3778 Talented Chef
- ZOJ 3778 Talented Chef
- ZOJ 3778 Talented Chef
- ZOJ 3778 Talented Chef
- ZOJ 3778 Talented Chef
- ZOJ 3778Talented Chef
- zoj 3778 Talented Chef
- zoj 3778 Talented Chef 模拟
- zoj 3778 Talented Chef 贪心
- ZOJ 3778 Talented Chef【贪心】
- ZOJ 3778 Talented Chef (贪心+二分)
- ZOJ Problem Set - 3778【Talented Chef】
- ZOJ 3778 Talented Chef(数学啊 )
- ZOJ 3778 Talented Chef(计算器模拟)
- ZOJ 3780Paint the Grid Again
- 【Android机制】IPC机制之AIDL
- Android上V8 JS引擎
- 计算簇间距离
- LruCache实现原理
- ZOJ 3778Talented Chef
- new balance 574 bybd arbz nooy
- [xxx respondsToSelector:]message sent to deallocated instance和空地址崩溃 空指针
- Groovy 与 DSL
- 头插法和尾插法建立链表区别
- 一个封装了StandardTokenizer的自定义Lucene Analyzer
- ADB backupAgent 提权漏洞分析 (CVE-2014-7953)
- 改用MyAnalyzer的KMeans聚类算法
- ZOJ 3787Access System(排序)