swap.cpp: In function 'std::vector<int> merge(int, std::vector<int>&, std::vector<int>&)':
swap.cpp:10:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
10 | for (int i = 0, j = 1; i < l.size(); i += j, j <<= 1) {
| ~~^~~~~~~~~~
swap.cpp: In function 'void dfs(int, int)':
swap.cpp:20:31: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
20 | if (!(((node >> i + 1) << 1) + j)) continue;
| ~~^~~
swap.cpp:21:45: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
21 | dp[node][i][j] = {a[((node >> i + 1) << 1) + j]};
| ~~^~~
swap.cpp:26:31: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
26 | if (!(((node >> i + 1) << 1) + j)) continue;
| ~~^~~
swap.cpp:27:37: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
27 | int val = a[((node >> i + 1) << 1) + j];
| ~~^~~
swap.cpp: In function 'int main()':
swap.cpp:48:46: warning: operation on 'n' may be undefined [-Wsequence-point]
48 | while (__builtin_popcount(n + 1) != 1) a[++n] = n;
| ^~~
swap.cpp:48:46: warning: operation on 'n' may be undefined [-Wsequence-point]
swap.cpp:45:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
45 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
swap.cpp:46:39: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
46 | for (int i = 1; i <= n; i++) scanf("%d", a + i);
| ~~~~~^~~~~~~~~~~~~