[GESP202412 二级] 数位和

Luogu
IDLGB4065
Time1000ms
Memory512MB
DifficultyP1
2024GESP
小杨有 $n$ 个正整数,小杨想知道这些正整数的数位和中最大值是多少。“数位和”指的是一个数字中所有数位的和。例如:对于数字 $12345$,它的各个数位分别是 $1,2,3,4,5$。将这些数位相加,得到 $$1+2+3+4+5=15$$ 因此,$12345$ 的数位和是 $15$。 ## Input 第一行包含一个正整数 $n$,代表正整数个数。 之后 $n$ 行,每行包含一个正整数。 ## Output 输出这些正整数的数位和的最大值。 [samples] ## Background 对应的选择、判断题:<https://ti.luogu.com.cn/problemset/1166> ## Note 对于全部数据,保证有 $1\leq n\leq 10^5$,每个正整数不超过 $10^{12}$。
Samples
Input #1
3
16
81
10
Output #1
9
API Response (JSON)
{
  "problem": {
    "name": "[GESP202412 二级] 数位和",
    "description": {
      "content": "小杨有 $n$ 个正整数,小杨想知道这些正整数的数位和中最大值是多少。“数位和”指的是一个数字中所有数位的和。例如:对于数字 $12345$,它的各个数位分别是 $1,2,3,4,5$。将这些数位相加,得到  $$1+2+3+4+5=15$$ 因此,$12345$ 的数位和是 $15$。",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 524288
    },
    "difficulty": {
      "LuoguStyle": "P1"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGB4065"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "小杨有 $n$ 个正整数,小杨想知道这些正整数的数位和中最大值是多少。“数位和”指的是一个数字中所有数位的和。例如:对于数字 $12345$,它的各个数位分别是 $1,2,3,4,5$。将这些数位相加,得到 \n\n$$1+2+3+4+5=15$$\n\n因此,$12345$ 的数位和是 $15$。\n\n## Input\n\n第一行包含一个正整数 $n$,代表正整数个数。\n\n之后 $n$ 行,每行包含一个正整...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments