Please read the new rule regarding the restriction on the use of AI tools. ×

sasuke123's blog

By sasuke123, 2 years ago, In English

So there's one more problem I cannot think any way of solving except brute force.

Question:

There's a array of strings, each string represents a number(length of string can be 10^5)

For each number represented as a string, we want to find whether it's of the form x^3 or x^3+4

(It's certain that number will be in either form)

The number are very large if the length of the string is 10^5 so we cannot use brute force or anything, any ideas?

Thank you

  • Vote: I like it
  • +1
  • Vote: I do not like it

| Write comment?
»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Whether x ^ 3 + 4 or x ^ 3, the number is limited