Leyland Number

AtCoder
IDabc320_a
Time2000ms
Memory256MB
Difficulty
You are given positive integers $A$ and $B$. Print the value $A^B+B^A$. ## Constraints * $2 \leq A \leq B \leq 9$ * All input values are integers. ## Input The input is given from Standard Input in the following format: $A$ $B$ [samples]
Samples
Input #1
2 8
Output #1
320

For $A = 2, B = 8$, we have $A^B = 256, B^A = 64$, so $A^B + B^A = 320$.
Input #2
9 9
Output #2
774840978
Input #3
5 6
Output #3
23401
API Response (JSON)
{
  "problem": {
    "name": "Leyland Number",
    "description": {
      "content": "You are given positive integers $A$ and $B$.   Print the value $A^B+B^A$.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc320_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given positive integers $A$ and $B$.  \nPrint the value $A^B+B^A$.\n\n## Constraints\n\n*   $2 \\leq A \\leq B \\leq 9$\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard I...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments