candies.cpp:12:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
main() {
^
candies.cpp: In function 'int main()':
candies.cpp:21:45: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
dp[j & 1][i] = max(dp[j & 1][i], dp[j & 1 ^ 1][i - 2] + a[i]);
~~^~~
candies.cpp:13:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
~~~~~^~~~~~~~~~
candies.cpp:15:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%lld", &a[i]);
~~~~~^~~~~~~~~~~~~~~