Count a, b, c satisfy a + b + c <= S and a * b * c <= T for large S, T

Правка en9, от SPyofgame, 2021-08-17 22:30:14

Statement

This question is based on bonus of this problem.

We need to count such triple $$$(a, b, c)$$$ that satisfy $$$(0 \leq a + b + c \leq S)$$$ and $$$(0 \leq a \times b \times c \leq T)$$$ and $$$min(a, b, c) \geq 0$$$

Since the result may be very big, you can either use bignum or modulo $$$10^9 + 7$$$ for convention


Notice that:

  • $$$(0, 0, 1) \neq (0, 1, 0) \neq (1, 0, 0)$$$

Constraint:

  • $$$0 \leq S, T \leq 10^{18}$$$

  • $$$0 \leq a, b, c$$$


No Time Limit. But expect to be 10 seconds


Memory Limit: 1Gb


Input:

  • A single line contain only two positive 60-bit integers $$$S$$$ and $$$T$$$ ($$$0 \leq S, T \leq 10^{18}$$$)

Output:

  • Print a single integer, the number of positive tuple satisfy mathematical condition

Example

Example 0
Example 1
Example 2
Example 3
Example 4
Example 5
Example 6
Теги #math, #algebra, #combinatorics

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en24 Английский SPyofgame 2022-03-27 20:25:23 103
en23 Английский SPyofgame 2021-08-26 21:40:29 10 Tiny change: ' is $O(T^{\frac{5}{9}})$\n\nWit' -> ' is $O(T^{5/9})$\n\nWit'
en22 Английский SPyofgame 2021-08-26 21:39:38 31
en21 Английский SPyofgame 2021-08-25 22:07:22 518 Tiny change: 'ler>\n\n> The answer ' -> 'ler>\n\n> After many hours, the answer '
en20 Английский SPyofgame 2021-08-25 21:59:48 1368
en19 Английский SPyofgame 2021-08-23 05:04:36 10 Tiny change: 'deone.com/myrecent)\n[Proof]' -> 'deone.com/yMi8tu)\n[Proof]'
en18 Английский SPyofgame 2021-08-22 22:32:16 1 Tiny change: 'rac{2}{3}}$ time &md' -> 'rac{2}{3}})$ time &md'
en17 Английский SPyofgame 2021-08-22 22:31:09 5440 Tiny change: 'der $830ms, 3640KB$\n\n[Code' -> 'der $830ms$\n\n[Code'
en16 Английский SPyofgame 2021-08-19 14:46:12 6 Tiny change: '00000000\n123456\nFull Out' -> '00000000\n\nFull Out'
en15 Английский SPyofgame 2021-08-19 14:39:26 9
en14 Английский SPyofgame 2021-08-19 13:38:05 907
en13 Английский SPyofgame 2021-08-18 15:14:27 10 Tiny change: '------\n\n### Example\n\n<spoil' -> '------\n\n**Example:**\n\n<spoil'
en12 Английский SPyofgame 2021-08-18 11:49:30 126
en11 Английский SPyofgame 2021-08-18 10:59:20 118
en10 Английский SPyofgame 2021-08-17 22:35:17 228
en9 Английский SPyofgame 2021-08-17 22:30:14 11 Tiny change: 'nOutput:\n2122766957\n```\n</s' -> 'nOutput:\n15007668845\n```\n</s'
en8 Английский SPyofgame 2021-08-17 22:28:01 86 Tiny change: '\nSince this number may be ve' -> '\nSince the result may be ve'
en7 Английский SPyofgame 2021-08-17 22:11:00 34 Tiny change: 'T \leq 10^18$)\n\n----' -> 'T \leq 10^{18}$)\n\n----'
en6 Английский SPyofgame 2021-08-17 22:00:04 305 Tiny change: 'eq T) and min(a, b, ' -> 'eq T) and $min(a, b, '
en5 Английский SPyofgame 2021-08-17 21:27:35 295
en4 Английский SPyofgame 2021-08-17 20:42:32 884
en3 Английский SPyofgame 2021-08-17 20:40:45 91
en2 Английский SPyofgame 2021-08-17 20:39:59 926
en1 Английский SPyofgame 2021-08-17 20:34:58 1220 Initial revision (published)