[NOIP 1998 提高组] 拼数

Luogu
IDLGP1012
Time1000ms
Memory128MB
DifficultyP5
字符串贪心1998NOIP 提高组排序状压 DP
设有 $n$ 个正整数 $a_1 \dots a_n$,请将它们联接成一排,相邻数字首尾相接,组成一个最大的整数。 ## Input 第一行有一个整数,表示数字个数 $n$。 第二行有 $n$ 个整数,表示给出的 $n$ 个整数 $a_i$。 ## Output 一个正整数,表示最大的整数。 [samples] ## Note 对于全部的测试点,保证 $1 \leq n \leq 20$,$1 \leq a_i \leq 10^9$。 NOIP1998 提高组 第二题
Samples
Input #1
3
13 312 343
Output #1
34331213
Input #2
4
7 13 4 246
Output #2
7424613
API Response (JSON)
{
  "problem": {
    "name": "[NOIP 1998 提高组] 拼数",
    "description": {
      "content": "设有 $n$ 个正整数 $a_1 \\dots a_n$,请将它们联接成一排,相邻数字首尾相接,组成一个最大的整数。",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 131072
    },
    "difficulty": {
      "LuoguStyle": "P5"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGP1012"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "设有 $n$ 个正整数 $a_1 \\dots a_n$,请将它们联接成一排,相邻数字首尾相接,组成一个最大的整数。\n\n## Input\n\n第一行有一个整数,表示数字个数 $n$。\n\n第二行有 $n$ 个整数,表示给出的 $n$ 个整数 $a_i$。\n\n## Output\n\n一个正整数,表示最大的整数。\n\n[samples]\n\n## Note\n\n对于全部的测试点,保证 $1 \\leq n \\leq ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments