[蓝桥杯 2020 省 B2] 平面切分

Luogu
IDLGP8720
Time1000ms
Memory128MB
DifficultyP3
计算几何2020蓝桥杯省赛
平面上有 $N$ 条直线, 其中第 $i$ 条直线是 $y=A_{i} \cdot x+B_{i}$ 。 请计算这些直线将平面分成了几个部分。 ## Input 第一行包含一个整数 $N$。 以下 $\mathrm{N}$ 行, 每行包含两个整数 $A_{i}, B_{i}$。 ## Output 一个整数代表答案。 [samples] ## Note 对于 $50 \%$ 的评测用例, $1 \leq N \leq 4,-10 \leq A_{i}, B_{i} \leq 10$。 对于所有评测用例, $1 \leq N \leq 1000,-10^5 \leq A_{i}, B_{i} \leq 10^5$。 蓝桥杯 2020 第二轮省赛 B 组 I 题
Samples
Input #1
3
1 1
2 2
3 3
Output #1
6
API Response (JSON)
{
  "problem": {
    "name": "[蓝桥杯 2020 省 B2] 平面切分",
    "description": {
      "content": "平面上有 $N$ 条直线, 其中第 $i$ 条直线是 $y=A_{i} \\cdot x+B_{i}$ 。 请计算这些直线将平面分成了几个部分。 ",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 131072
    },
    "difficulty": {
      "LuoguStyle": "P3"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGP8720"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "平面上有 $N$ 条直线, 其中第 $i$ 条直线是 $y=A_{i} \\cdot x+B_{i}$ 。\n\n请计算这些直线将平面分成了几个部分。\n\n## Input\n\n第一行包含一个整数 $N$。\n\n以下 $\\mathrm{N}$ 行, 每行包含两个整数 $A_{i}, B_{i}$。\n\n## Output\n\n一个整数代表答案。\n\n[samples]\n\n## Note\n\n对于 $50 \\%$ 的评...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments