📄 pku2709.cpp
字号:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int cp(const void *a, const void *b)
{
return *(int *)a - *(int *)b;
}
int main()
{
int N, i;
int col[13], max, gray;
while (scanf("%d", &N) != -1 && N > 0)
{
for (i = 0; i < N; i++)
{
scanf("%d", col + i);
}
scanf("%d", &gray);
qsort(col, N, sizeof(col[0]), cp);
max = col[N - 1];
while (gray > 0)
{
col[0]++;
col[1]++;
col[2]++;
gray--;
qsort(col, N, sizeof(col[0]), cp);
max = col[N - 1];
}
printf("%d\n", (max + 49) / 50);
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -