Exponential

AtCoder
IDabc097_b
Time2000ms
Memory256MB
Difficulty
You are given a positive integer $X$. Find the largest _perfect power_ that is at most $X$. Here, a perfect power is an integer that can be represented as $b^p$, where $b$ is an integer not less than $1$ and $p$ is an integer not less than $2$. ## Constraints * $1$ $≤$ $X$ $≤$ $1000$ * $X$ is an integer. ## Input Input is given from Standard Input in the following format: $X$ [samples]
Samples
Input #1
10
Output #1
9

There are four perfect powers that are at most $10$: $1$, $4$, $8$ and $9$. We should print the largest among them, $9$.
Input #2
1
Output #2
1
Input #3
999
Output #3
961
API Response (JSON)
{
  "problem": {
    "name": "Exponential",
    "description": {
      "content": "You are given a positive integer $X$. Find the largest _perfect power_ that is at most $X$. Here, a perfect power is an integer that can be represented as $b^p$, where $b$ is an integer not less than ",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc097_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given a positive integer $X$. Find the largest _perfect power_ that is at most $X$. Here, a perfect power is an integer that can be represented as $b^p$, where $b$ is an integer not less than ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments