Home > Back-end >  Programming problem
Programming problem

Time:03-19

X correction on CSP in front of the school training,

A total of n OIer to participate in the training, coach for their carefully prepared m sets of simulated game problem,

Each OIer, however, has its own time arrangement, by coincidence, they are just in the next kk days have mm days are free to play Roger,

For the convenience of management, the coach one mm sets of simulated game must be played in sequence,

Little X, for example, in the next 2,3,5 free day to play Roger, so he has to play 1 set of simulated game in 2 days, 33 days playing 2 sets of simulated game title, 5 days playing 3 sets of simulated game problem,

Coaches need for every one every simulated game preparation, in order to reduce the workload, if one day have more than one person to play the same set of simulated game title, then the coach only needs during the day to prepare a simulated game can use this set of questions,

You, as the engine room, the coach would like to invite you to help him calculate, how much he need to prepare every day a simulated game,


Have any members can see what's the problem with this code? The last paragraph can't have been

CodePudding user response:

This good around ,
 # include 

A [1004] [1004]={0};
Int main ()
{
Int n, m, k, I, j, b;//o, d [1004]
The scanf (" % d % d % d ", & amp; N, & amp; M, & amp; K);//n m sets the topic the first k days lines
//the second line of each person which day
for (i=0; iFor (j=0; jThe scanf (" % d ", & amp; B); Which day//everyone
[b] [j]=1;//directly to b day marking
}
}
/* for (I=0; iFor (j=0; jIf (d [a [j] [I]]==0 | | b! I)={
B=I;
D [a [j] [I]] + +;
}

}
} */
for (i=1; i<=k; I++) {//statistics according to the number of days
n=0;
For (j=0; jIf (a [I] [j]) n++;
Printf (" % d ", n);
}

return 0;
}
  • Related