[NOIP 1999 普及组] Cantor 表

Luogu
IDLGP1014
Time1000ms
Memory128MB
DifficultyP2
模拟数学1999NOIP 普及组枚举
现代数学的著名证明之一是 Georg Cantor 证明了有理数是可枚举的。他是用下面这一张表来证明这一命题的: ![](https://cdn.luogu.com.cn/upload/image_hosting/jdjdaf73.png) 我们以 Z 字形给上表的每一项编号。第一项是 $1/1$,然后是 $1/2$,$2/1$,$3/1$,$2/2$,… ## Input 整数 $N$($1 \leq N \leq 10^7$)。 ## Output 表中的第 $N$ 项。 [samples] ## Note - 2024-11-18 0:30 数据中加入了样例,放在不计分的子任务 2 中。
Samples
Input #1
7
Output #1
1/4
API Response (JSON)
{
  "problem": {
    "name": "[NOIP 1999 普及组] Cantor 表",
    "description": {
      "content": "现代数学的著名证明之一是 Georg Cantor 证明了有理数是可枚举的。他是用下面这一张表来证明这一命题的: ![](https://cdn.luogu.com.cn/upload/image_hosting/jdjdaf73.png) 我们以 Z 字形给上表的每一项编号。第一项是 $1/1$,然后是 $1/2$,$2/1$,$3/1$,$2/2$,…",
      "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": "LGP1014"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "现代数学的著名证明之一是 Georg Cantor 证明了有理数是可枚举的。他是用下面这一张表来证明这一命题的:\n\n![](https://cdn.luogu.com.cn/upload/image_hosting/jdjdaf73.png)\n\n我们以 Z 字形给上表的每一项编号。第一项是 $1/1$,然后是 $1/2$,$2/1$,$3/1$,$2/2$,…\n\n## Input\n\n整数 $N$(...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments