5798 | 2023-10-01 14:44:40 | xxx | Bájital (80 pont) | cpp14 | Forditási hiba |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<n;i++)
int main() {
int n, x;
cin >> n >> x;
vector<int> a(n);
int xs = 0, ns = 0, ans = 0;
rep(i. n) {
cin >> a[i];
xs += a[i]/x;
ns += a[i]%x;
}
if (ns >= xs) {
cout << xs << "\n";
return 0;
}
if ((xs-ns) % (x+1) == 0) {
cout << xs - ((xs-ns)/(x+1)) << "\n";
} else {
cout << xs - ((xs-ns)/(x+1)+1) << "\n";
}
cout << ans << "\n";
return 0;
}
exit status 1
main.cpp:10:17: error: macro "rep" requires 2 arguments, but only 1 given
10 | rep(i. n) {
| ^
main.cpp:3: note: macro "rep" defined here
3 | #define rep(i, n) for(int i=0;i<n;i++)
|
main.cpp: In function 'int main()':
main.cpp:10:9: error: 'rep' was not declared in this scope
10 | rep(i. n) {
| ^~~
Exited with error status 1