[GESP202309 五级] 因数分解

Luogu
IDLGB3871
Time1000ms
Memory128MB
DifficultyP2
2023数论GESP
每个正整数都可以分解成素数的乘积,例如: $6=2\times 3$,$20=2^2\times5$。 现在,给定一个正整数,请按要求输出它的因数分解式。 ## Input 输入第一行,包含一个正整数 $N$。约定 $2 \le N \le 10^{12}$。 ## Output 输出一行,为的因数分解式。要求按质因数由小到大排列,乘号用星号 `*` 表示,且左右各空一格。当且仅当一个素数出现多次时,将它们合并为指数形式,用上箭头 `^` 表示,且左右不空格。 [samples] ## Background 对应的选择、判断题:<https://ti.luogu.com.cn/problemset/1131>
Samples
Input #1
6
Output #1
2 * 3
Input #2
20
Output #2
2^2 * 5
Input #3
23
Output #3
23
API Response (JSON)
{
  "problem": {
    "name": "[GESP202309 五级] 因数分解",
    "description": {
      "content": "每个正整数都可以分解成素数的乘积,例如: $6=2\\times 3$,$20=2^2\\times5$。 现在,给定一个正整数,请按要求输出它的因数分解式。",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 131072
    },
    "difficulty": {
      "LuoguStyle": "P2"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGB3871"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "每个正整数都可以分解成素数的乘积,例如: $6=2\\times 3$,$20=2^2\\times5$。\n\n现在,给定一个正整数,请按要求输出它的因数分解式。\n\n## Input\n\n输入第一行,包含一个正整数 $N$。约定 $2 \\le N \\le 10^{12}$。\n\n## Output\n\n输出一行,为的因数分解式。要求按质因数由小到大排列,乘号用星号 `*` 表示,且左右各空一格。当且仅当一个素...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments