Presort array by kcm1700

#import<algorithm>
#import<cstdio>
#import<vector>
int main(){for(int d,l;~getchar();printf("]\n")){std::vector<std::vector<int> >t(2);for(l=0;scanf("%d%*c",&d)==1;t.back().push_back(l=d))if(d<l)t.push_back(t[0]);std::sort(&t[0],&t.back()+1);for(d=0;d<t.size();d++)for(l=0;l<t[d].size();)printf("%c%d",d+l-2?44:91,t[d][l++]);}}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page