report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Maximum value arrangement - FlandreOJ: Flandre Online Judge

Maximum value arrangement

Time limit: 1000 ms
Memory limit: 256 MB
Given an array $A$ of $n$ positive integers, the task is to rearrange the elements of $A$ in any order and merge them into a single integer. For example, merging the array $A = \\{23, 12, 6\\}$ would result in the integer $23126$. The goal is to determine the maximum value that can be achieved through this merging process. ### Input - The first line contains an integer $n$. - The second line contains $n$ integer $A_i$. ### Output - The maximum value you can achieve. ### Constraints - $1 \le n \le 10^5$. - $1 \le A_i \le 10^9$. ### Example Input: ``` 3 23 12 6 ``` Output: ``` 62312 ``` **Note: arrange elements as $\\{6,23,12\\}$**.
Sorting
Points Sorting
Brewing potion
Smallest possible
Distance minimization
Segment
Cucumber
Maximum value arrangement
Buttons game
Building fence
Balance
Topic
Sorting
Greedy
Rating 1100
Solution (1) Solution