QOJ.ac

QOJ

시간 제한: 0.1 s 메모리 제한: 256 MB 총점: 100

#15576. Irrational Roots

통계

设 $n$ 为一个自然数,$n \le 8$。考虑以下方程:

$$x^n + c_{n-1}x^{n-1} + c_{n-2}x^{n-2} + \dots + c_1x + c_0 = 0$$

其中 $c_{n-1}, c_{n-2}, \dots, c_1, c_0$ 是整数且 $c_0 \neq 0$。

已知该方程的所有 $n$ 个根均为实数。我们已知方程的每个根 $r$ 都满足条件:$-10 \le r \le 10$。此外,可能存在重根(即出现多次的根)。

求该方程的无理数根的数量(无理数根是指其值为无理数的根)。

输入格式

输入包含单组测试数据。

第一行包含一个整数 $n$。

第二行包含 $c_{n-1}, c_{n-2}, \dots, c_1, c_0$ 的值,每两个相邻的值之间用一个空格隔开。

输出格式

输出该方程的无理数根的数量。

样例

输入样例 1

6
12 -12 -454 -373 3754 1680

输出样例 1

2

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.