题目链接:Codeforces 439A Devu, the Singer and Churu, the Joker
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int n, d, sum = 0, arr[120];
scanf("%d%d", &n, &d);
for(int i = 0; i < n; i++)
{
scanf("%d", &arr[i]);
sum += arr[i];
}
if(sum + (n - 1) * 10 > d)
puts("-1");
else
printf("%d\n", (d - (sum + (n - 1) * 10)) / 5 + (n - 1) * 10 / 5);
return 0;
}
本文介绍了如何解决Codeforces平台上的439A Devu, the Singer and Churu, the Joker问题,通过分析给定代码实现,理解其背后的算法思想与逻辑,提供解题思路与技巧。
286

被折叠的 条评论
为什么被折叠?



