Problem sumint
User bribritt
Submission Time 2026-01-04 18:15:34
Score 0
Max Time N/A
Max Memory N/A

Compile Error

sumint.cpp:6:16: error: expected ',' or ')', found "."
6 | #define range(a.b) [](int x, int y){vector<int> v(y-x); iota(v.begin(),v.end(),x); return v;}(a,b)
| ^
sumint.cpp:12:20: error: macro "range" requires 3 arguments, but only 1 given
12 | for(int i: range(n))
| ^
sumint.cpp:7: note: macro "range" defined here
7 | #define range(a,b,c) [](int x, int y, int z){assert(z); vector<int> v; for(int i=x;(i>y&&z<0)||(i<y&&z>0);i+=z) v.push_back(i); return v;}(a,b,c)
|
sumint.cpp:15:20: error: macro "range" requires 3 arguments, but only 1 given
15 | for(int i: range(n))
| ^
sumint.cpp:7: note: macro "range" defined here
7 | #define range(a,b,c) [](int x, int y, int z){assert(z); vector<int> v; for(int i=x;(i>y&&z<0)||(i<y&&z>0);i+=z) v.push_back(i); return v;}(a,b,c)
|
sumint.cpp: In function ‘int mai