Page 2 of 4
WA 11321 - Sort! Sort!! and Sort!!!
Posted: Mon May 19, 2008 10:27 pm
by mukit
Some one please where i did wrong ? I got lots of WA
Thank's in advance.
Re: 11321 - Sort! Sort!! and Sort!!!
Posted: Fri Jun 20, 2008 8:38 am
by lnr
Removed
Re: 11321 - Sort! Sort!! and Sort!!!
Posted: Fri Jun 20, 2008 8:46 am
by lnr
Removed
Why WA?????[:(]
Posted: Sat Jun 21, 2008 2:48 pm
by Chirag Chheda
Can neone plz tell me whr m i going wrong . i use sort function from STL...i cleared all the test cases given in the forum...
thnx in advance....
Re: 11321 - Sort! Sort!! and Sort!!!
Posted: Sun Jun 22, 2008 8:59 am
by emotional blind
Prolem is here
Code: Select all
if(n1>n2)
return true;
else
return true;
Re: 11321 - Sort! Sort!! and Sort!!!
Posted: Sun Jun 22, 2008 10:52 am
by Chirag Chheda
Thank you Sir!!!
finalyy i got ACC
11321 - Sort! Sort!! and Sort!!! Why WA
Posted: Tue Jun 24, 2008 5:52 am
by lnr
Thanks Jan.
Code Removed.
Re: 11321 - Sort! Sort!! and Sort!!!
Posted: Wed Jun 25, 2008 10:38 pm
by Jan
Try the cases.
Input:
Code: Select all
3 3
9
12
10
15 3
-1
-2
-3
-4
-5
6
7
8
9
-10
-11
-12
-13
14
15
0 0
Output:
Code: Select all
3 3
9
12
10
15 3
-5
-11
-2
-1
-13
-10
-4
15
9
-3
-12
6
7
8
14
0 0
Re: 11321 - Sort! Sort!! and Sort!!!
Posted: Thu Jun 26, 2008 7:41 am
by Chirag Chheda
Well the output to the second part in the above example is wrong.
I think -5 should come before -3 as -5%3=-2 & -3%3=0
My Acc prog gives the following output:
15 3
-5
-11
-2
-1
-13
-10
-4
15
9
-3
-12
6
7
8
14
0 0
11321 - Sort! Sort!! and Sort!!!
Posted: Thu Jun 26, 2008 12:41 pm
by lnr
It is confusing.
Jan's output and Cherag Chheda's output are different for the same input.
How is it possible?
Please explain.
11321 - Sort! Sort!! and Sort!!!
Posted: Thu Jun 26, 2008 12:48 pm
by lnr
I think Jan's output is wrong.Isn't it?
It may be a copy pase mistake.
Re: 11321 - Sort! Sort!! and Sort!!!
Posted: Fri Jun 27, 2008 7:45 am
by Jan
You are right. I have changed the output. I forgot to change from '%lld' to '%I64d'. Sorry about that.
11321 - Sort! Sort!! and Sort!!! WA
Posted: Fri Jun 27, 2008 8:12 am
by lnr
Code Removed
Re: 11321 - Sort! Sort!! and Sort!!!
Posted: Fri Jun 27, 2008 8:49 am
by Jan
Try the case.
Input
Code: Select all
9 2
-15509
-13005
-4058
-11173
-10564
16391
-1396
-12098
-15847
0 0
Output:
Code: Select all
9 2
-11173
-13005
-15509
-15847
-12098
-10564
-4058
-1396
16391
0 0
Hope it helps.
11321 - Sort! Sort!! and Sort!!!
Posted: Mon Jun 30, 2008 3:17 pm
by lnr
Removed.