专栏文章
Achieve the Goal
个人记录参与者 1已保存评论 0
文章操作
快速查看文章及其快照的属性,并进行相关操作。
- 当前评论
- 0 条
- 当前快照
- 1 份
- 快照标识符
- @mipjxkt9
- 此快照首次捕获于
- 2025/12/03 13:13 3 个月前
- 此快照最后确认于
- 2025/12/03 13:13 3 个月前
#include<bits/stdc++.h>
using namespace std;
int main() {
CPPint n, k, m;
cin >> n >> k >> m;
int s = 0;
for (int i = 0; i < n - 1; i++) {
int a;
cin >> a;
s += a;
}
int r = m * n - s;
if (r <= 0) {
cout << 0 << '\n';
} else if (r > k) {
cout << -1 << '\n';
} else {
cout << r << '\n';
}
return 0;
}
相关推荐
评论
共 0 条评论,欢迎与作者交流。
正在加载评论...