swap.cpp: In function 'int main()':
swap.cpp:39:45: error: 'tie' was not declared in this scope
if(i*2 <= N && A[i*2] < ret) tie(ret, idx) = (pii){A[i*2], i*2};
^
swap.cpp:40:49: error: 'tie' was not declared in this scope
if(i*2+1 <= N && A[i*2+1] < ret) tie(ret, idx) = (pii){A[i*2+1], i*2+1};
^
swap.cpp:42:75: error: 'tie' was not declared in this scope
if((i-1)*2 <= N && A[(i-1)*2] < ret && B[i-1] == (i-1)*2) tie(ret, idx) = (pii){A[(i-1)*2], (i-1)*2};
^
swap.cpp:43:81: error: 'tie' was not declared in this scope
if((i-1)*2+1 <= N && A[(i-1)*2+1] < ret && B[i-1] == (i-1)*2+1) tie(ret, idx) = (pii){A[(i-1)*2+1], (i-1)*2+1};
^
swap.cpp:48:45: error: 'tie' was not declared in this scope
if(i*2 <= N && A[i*2] < ret) tie(ret, idx) = (pii){A[i*2], i*2};
^
swap.cpp:49:49: error: 'tie' was not declared in this scope
if(i*2+1 <= N && A[i*2+1] < ret) tie(ret, idx) = (pii){A[i*2+1], i*2+1};
^
swap.cpp:50:62: error: 'tie' was not declared in this scope
if(i+1 <= N && A[i+1] < ret && B[i/2] == i+1) tie(ret, idx) = (pii){A[i+1], i+1};
^
swap.cpp:26:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &N);
^
swap.cpp:27:48: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for(int i = 1; i <= N; i++) scanf("%d", &A[i]);
^