Problem lightningrod
User jmuzhen
Submission Time 2025-06-11 22:22:10
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lightningrod.cpp: In function ‘int main()’:
lightningrod.cpp:41:14: error: request for member ‘first’ in ‘v.std::vector<int>::operator[](((std::vector<int>::size_type)i))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
41 | #define diff first
| ^~~~~
lightningrod.cpp:54:14: note: in expansion of macro ‘diff’
54 | v[i].diff = y - x;
| ^~~~
lightningrod.cpp:42:13: error: request for member ‘second’ in ‘v.std::vector<int>::operator[](((std::vector<int>::size_type)i))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
42 | #define sum second
| ^~~~~~
lightningrod.cpp:55:14: note: in expansion of macro ‘sum’
55 | v[i].sum = y + x;
| ^~~
lightningrod.cpp:57:14: error: no match for ‘operator+’