Search found 3 matches
- Mon Oct 22, 2007 12:59 am
- Forum: Volume 113 (11300-11399)
- Topic: 11321 - Sort! Sort!! and Sort!!!
- Replies: 50
- Views: 29529
- 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 ...
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 ...
- 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 ...
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 ...