Very annoying a topic, only in a servant to add blood, unfortunately, the game time one hours, did not want to understand, the code will always have a number of mistakes in the wrong. Very annoying
#include <bits\stdc++.h> using namespace std; struct Node {Long long x, Y, Z;}
A[200005];
BOOL CMP (node B,node c) {return b.z<c.z;} long long Pow1 (long long n,int k) {Long long ans=n;
for (int i=1;i<=k;i++) ans*=2;
return ans; } int main () {int n,c,b; scanf ("%d%d%d", &n,&c,&b), long long max1=0,sum=0; for (int i=0;i<n;i++) scanf ("%i6
4d%i64d ", &a[i].x,&a[i].y), a[i].z=a[i].x-a[i].y;
Sort (a,a+n,cmp);
int t=n;
For the IF (int i=0;i<n;i++) if (i+b<n) sum+=a[i].y;//race, write i+t else if (a[i].z<0) sum+=a[i].y;
else {if (t==n) t=i;
sum+=a[i].x;}
if (b==0) {printf ("%i64d\n", sum);
return 0;
} max1=sum;
a[n].x=0;
a[n].y=0;
a[n].z=0; for (int i=0;i<n;i++) {if (i<t&&n-t==b) {Max1=max (Max1,sum-a[t].x+a[t].y+max (Pow1), a[i].x,c)-A
[I].Y];
} else {Max1=max (Max1,sum-max (A[I].X,A[I].Y) +pow1 (a[i].x,c));
}} printf ("%i64d\n", max1);
return 0;
}