poj 2709 贪心 painter
2014-07-16 15:59
253 查看
#include <iostream> #include <stdio.h> #include <algorithm> using namespace std; int main() { int n; int gray,color[1001]; while(scanf("%d",&n)!=EOF) { if(n==0) break; for(int i=0;i<n;i++) scanf("%d",&color[i]); scanf("%d",&gray); sort(color,color+n); while(gray--) { color[0]++; color[1]++; color[2]++; sort(color,color+n); } sort(color,color+n); int max=color[n-1]; int ans=(max%50==0)? (max/50):(max/50+1); printf("%d\n",ans); } return 0; }
相关文章推荐
- POJ-2709-Painter(贪心)
- POJ 2709 Painter 贪心
- poj 2709 Painter(贪心)
- POJ 2709 Painter 贪心详解
- POJ | 2709 Painter | 贪心
- poj 2709 Painter (贪心)
- 【原创】【合并类贪心】POJ 3253 1862 2709; Fence Repair && Stripies && Painter
- POJ—2709—Painter—【贪心】
- POJ--2709:Painter (贪心)
- poj 2709 Painter 坑爹贪心
- poj 2709 贪心暴搜
- poj 2709 Painter
- POJ 2709 painter
- poj 2709 - Painter
- POJ 2709 颜料盒数量 贪心法
- POJ 2709 颜料盒数量 贪心法
- poj 2709 贪心
- POJ 2709-Painters 贪心问题
- 【POJ 2709】Painter
- POJ_2709_Painter