[GESP202406 五级] 小杨的幸运数字

Luogu
IDLGP10720
Time1000ms
Memory500MB
DifficultyP2
2024数论GESP
小杨认为他的幸运数字应该恰好有两种不同的质因子,例如,$12=2\times 2\times 3$ 的质因子有 $2,3$,恰好为两种不同的质因子,因此 $12$ 是幸运数字,而 $30=2\times3\times5$ 的质因子有 $2,3,5$,不符合要求,不为幸运数字。 小杨现在有 $n$ 个正整数,他想知道每个正整数是否是他的幸运数字。 ## Input 第一行包含一个正整数 $n$,代表正整数个数。 之后 $n$ 行,每行一个正整数。 ## Output 输出 $n$ 行,对于每个正整数,如果是幸运数字,输出 $1$,否则输出 $0$。 [samples] ## Background 对应的选择、判断题:<https://ti.luogu.com.cn/problemset/1153> ## Note ### 样例解释 $7$ 的质因子有 $7$,只有一种。 $12$ 的质因子有 $2,3$,恰好有两种。 $30$ 的质因子有 $2,3,5$,有三种。 ### 数据范围 子任务编号|数据点占比|$n$|正整数值域 :-:|:-:|:-:|:-: $1$|$40\%$|$\leq 100$|$\leq 10^5$ $2$|$60\%$|$\leq 10^4$|$\leq 10^6$ 对于全部数据,保证有 $1\leq n\leq 10^4$,每个正整数 $a_i$ 满足 $2\leq a_i\leq 10^6$。
Samples
Input #1
3
7
12
30
Output #1
0
1
0
API Response (JSON)
{
  "problem": {
    "name": "[GESP202406 五级] 小杨的幸运数字",
    "description": {
      "content": "小杨认为他的幸运数字应该恰好有两种不同的质因子,例如,$12=2\\times 2\\times 3$ 的质因子有 $2,3$,恰好为两种不同的质因子,因此 $12$ 是幸运数字,而 $30=2\\times3\\times5$ 的质因子有 $2,3,5$,不符合要求,不为幸运数字。 小杨现在有 $n$ 个正整数,他想知道每个正整数是否是他的幸运数字。",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 512000
    },
    "difficulty": {
      "LuoguStyle": "P2"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGP10720"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "小杨认为他的幸运数字应该恰好有两种不同的质因子,例如,$12=2\\times 2\\times 3$ 的质因子有 $2,3$,恰好为两种不同的质因子,因此 $12$ 是幸运数字,而 $30=2\\times3\\times5$ 的质因子有 $2,3,5$,不符合要求,不为幸运数字。\n\n小杨现在有 $n$ 个正整数,他想知道每个正整数是否是他的幸运数字。\n\n## Input\n\n第一行包含一个正整数 $n$...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments