link :
Method: Quasi- matrix + maximal linear Independent group
Resolution: above
This problem is the elimination of the part of the change just a bit.
It turns out that the 01 string is now fading matrix.
Code:
#include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <
Algorithm> #define N 510 #define EPS 1e-5 using namespace std;
int n,m;
struct Node {double z[n];
Double cost;
}a[n];
int b[n];
int cmp (node X,node y) {return x.cost<y.cost;} int main () {scanf ("%d%d", &n,&m);
for (int i=1;i<=n;i++) {for (int j=1;j<=m;j++) {scanf ("%lf", &a[i].z[j]);
for (int i=1;i<=n;i++) scanf ("%lf", &a[i].cost);
Sort (a+1,a+n+1,cmp);
int cnt=0;
Double ans=0;
for (int i=1;i<=n;i++) {for (int j=1;j<=m;j++) {if (Fabs (a[i].z[j)) >eps)
{if (!b[j]) {b[j]=i;
Break
}else {double rate=a[i].z[j]/a[b[j]].z[j];
for (int k=1;k<=m;k++) { A[I].Z[K]-=RATE*A[B[J]].Z[K];
'}} ' int flag=0;
for (int j=1;j<=m;j++) {if (Fabs (a[i].z[j)) >eps) {flag=1;break;}
} if (flag) cnt++,ans+=a[i].cost;
printf ("%d%.0lf\n", Cnt,ans); }