"Everyday Learning" "Search/Sort + string" 1012/1107 maximum integer

Source: Internet
Author: User

Reprint please specify the source [ametake All rights reserved]http://blog.csdn.net/ametake Welcome to see

Valley 1107 Max Integer

Address: http://www.luogu.org/problem/show?pid=1107

Topic Description Narrationthere are n positive integers (n<=20), which are concatenated into a row to form the largest multi-bit integer.
For Example: n=3, 3 integers 13, 312, 343 are concatenated into the largest integer: 34331213
also such as: n=4, 4 integer 7,13,4,246 concatenated into the largest integer is: 7424613Input/output formatInput Format:

N
N Number

output Format:

Number of multiple digits connected

Input and output examplesInput Example #:
313 312 34347 13 4 246
Output Example #:
343312137424613
Let's see how it works, I'm not throwing up. The problem of the layout of a drama is sad, it is not flattering


This topic was originally used for search or greed? In short I hung countless times ... Then read a man's explanation to find the choice of sort is an artifact = = but I don't believe it. So the unauthorized attempt to bubble sort = = even though the bubble sort I wrote wrong But after all it was wrong, the real bubble is not correct.

Bubbling may not be correct because the bubble puts the biggest back and the sorting is really powerless to try ...


In fact the principle is very easy. is to put two strings together in a row opposite the order of the largest number of the 22 comparison

Code ~



-Joys and sorrows are always ruthless. One order before the drip to the dawn.

"Everyday Learning" "Search/Sort + string" 1012/1107 maximum integer

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.