|
|
вернуться в форумwa#6... who can tell me what the test6 is? Thanks Re: wa#6... If you are using sort in your algo and sorting pairs<char ch,int position>, you must compare this pairs by a "ch", but if "ch"`s are equal - you must compare "position". Comparsion function may be like that: struct s{char c;int p;}; bool cmp(s a, s b) { if(a.c!=b.c) { return a.c<b.c; } return a.p<b.p; } Re: wa#6... Use stable_sort instead of sort (if you're doing on C/C++) |
|
|