[蓝桥杯 2023 国 B] 拼数字

Luogu
IDLGP9427
Time1000ms
Memory512MB
DifficultyP5
2023蓝桥杯国赛
小蓝要用 $N$ 个数字 $2$ 和 $M$ 个数字 $3$ 拼出一个 $N + M$ 位的整数。请你计算小蓝能拼出的最大的 $2023$ 的倍数是多少? ## Input 两个整数 $N$ 和 $M$。 ## Output 一个 $N + M$ 位的整数,代表答案。如果拼不出 $2023$ 的倍数,输出 $-1$。 [samples] ## Note ### 评测用例规模与约定 - 对于 $20\%$ 的数据,$1 \le N, M \le 12$。 - 对于 $40\%$ 的数据,$1 \le N, M \le 100$。 - 对于 $60\%$ 的数据,$1 \le N, M \le 10000$。 - 对于 $100\%$ 的数据,$1 \le N, M \le 1000000$。 第十四届蓝桥杯大赛软件赛决赛 C/C++ 大学 B 组 I 题
Samples
Input #1
2 8
Output #1
2233333333
API Response (JSON)
{
  "problem": {
    "name": "[蓝桥杯 2023 国 B] 拼数字",
    "description": {
      "content": "小蓝要用 $N$ 个数字 $2$ 和 $M$ 个数字 $3$ 拼出一个 $N + M$ 位的整数。请你计算小蓝能拼出的最大的 $2023$ 的倍数是多少?",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 524288
    },
    "difficulty": {
      "LuoguStyle": "P5"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGP9427"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "小蓝要用 $N$ 个数字 $2$ 和 $M$ 个数字 $3$ 拼出一个 $N + M$ 位的整数。请你计算小蓝能拼出的最大的 $2023$ 的倍数是多少?\n\n## Input\n\n两个整数 $N$ 和 $M$。\n\n## Output\n\n一个 $N + M$ 位的整数,代表答案。如果拼不出 $2023$ 的倍数,输出 $-1$。\n\n[samples]\n\n## Note\n\n### 评测用例规模与约定\n\n...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments