A^B^C

AtCoder
IDarc113_b
Time2000ms
Memory256MB
Difficulty
Given positive integers $A, B, C$, find the digit at the ones place in the decimal notation of $A^{B^C}$. ## Constraints * $1\leq A,B,C \leq 10^9$ * $A,B,C$ are integers. ## Input Input is given from Standard Input in the following format: $A$ $B$ $C$ [samples]
Samples
Input #1
4 3 2
Output #1
4

The ones digit in the decimal notation of $4^{3^2}=4^9=262144$ is $4$.
Input #2
1 2 3
Output #2
1
Input #3
3141592 6535897 9323846
Output #3
2
API Response (JSON)
{
  "problem": {
    "name": "A^B^C",
    "description": {
      "content": "Given positive integers $A, B, C$, find the digit at the ones place in the decimal notation of $A^{B^C}$.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "arc113_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Given positive integers $A, B, C$, find the digit at the ones place in the decimal notation of $A^{B^C}$.\n\n## Constraints\n\n*   $1\\leq A,B,C \\leq 10^9$\n*   $A,B,C$ are integers.\n\n## Input\n\nInput is giv...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments