QOJ.ac

QOJ

時間限制: 2 s 記憶體限制: 512 MB 總分: 100

#13464. funkcja

统计

Niech $P(x)$ oznacza liczbę takich $y$, że $1 < y < x$ oraz $y^3 \equiv 1 \pmod x$.

Oblicz, ile jest dodatnich liczb całkowitych nie większych niż $n$, dla których $P(x) = m$.

Wejście

W jednej linii podano dwie liczby całkowite $n, m$.

Wyjście

Wypisz jedną liczbę oznaczającą wynik.

Przykład

Przykład 1

Wejście:

10 0

Wyjście:

8

Przykład 2

Wejście:

100000000 242

Wyjście:

24038

Podzadania

Dla $100\%$ danych wejściowych: $1 < n \le 2 \times 10^{10}$ oraz $0 \le m < n$.

Numer testu $n$ $m$
$1$ $\le 2\times 10^{10}$ $=666$
$2$ $\le 10^3$
$3$ $\le 10^5$
$4$ $\le 10^6$
$5$ $\le 3\times 10^6$
$6$ $\le 5\times 10^6$
$7$ $\le 10^7$
$8$ $\le 10^8$ $\ge 300$
$9$ $\le 5\times 10^8$
$10$ $\le 10^9$
$11$ $\le 5\times 10^9$ $\ge 200$
$12$ $\le 10^{10}$
$13$ $=0$
$14$ $\le 2\times 10^{10}$
$15$ $\le 10^8$
$16$ $\le 5\times 10^8$
$17$ $\le 10^9$
$18$ $\le 5\times 10^9$
$19$ $\le 10^{10}$
$20$ $\le 2\times 10^{10}$

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.