Search found 3 matches

by Orion
Mon Oct 22, 2007 12:59 am
Forum: Volume 113 (11300-11399)
Topic: 11321 - Sort! Sort!! and Sort!!!
Replies: 50
Views: 29529

i recommend you to use the sort () algorithm in <algorithm> or qsort in <cstdlib> with the criteria specified in the problem instead of implementing your own, and try not to use and sort three arrays, you just need one array
by Orion
Sun Oct 21, 2007 1:50 am
Forum: Volume 113 (11300-11399)
Topic: 11321 - Sort! Sort!! and Sort!!!
Replies: 50
Views: 29529

Re: 11321 - Sort! Sort!! and Sort!!!

Hi, can someone give me a hand on this problem, i got WA , i just used a sort with the criteria explained in the problem:

the function used to compare:


int modcmp (int *a, int *b) {
...
return *a - *b; // when both are even the smaller precede the larger
...


Please note that the numbers are ...
by Orion
Sun Oct 21, 2007 1:28 am
Forum: Volume 113 (11300-11399)
Topic: 11321 - Sort! Sort!! and Sort!!!
Replies: 50
Views: 29529

11321 - Sort! Sort!! and Sort!!!

Hi, can someone give me a hand on this problem, i got WA , i just used a sort with the criteria explained in the problem:

the function used to compare:


int modcmp (int *a, int *b) {

int m1 = *a % m;
int m2 = *b % m;
if (m1 != m2)
return m1 - m2;

if ( (*a % 2) == 0 ) {
if ( (*b %2) == 0 ...

Go to advanced search