QOJ.ac

QOJ

时间限制: 1 s 内存限制: 16 MB 总分: 10

#11667. 你会乘方吗?

统计

给定两个自然数 $a$ 和 $b$,求 $a^b$ 的最后一位数字。

编写一个程序,完成以下任务:

  • 读取底数 $a$ 和指数 $b$。
  • 计算 $a^b$ 的最后一位数字。
  • 输出结果。

输入格式

输入的第一行也是唯一一行包含两个整数 $a$ 和 $b$ ($1 \le a, b \le 1\,000\,000\,000$),中间用空格隔开。

输出格式

你的程序应当仅输出 $a^b$ 的最后一位(最低位)数字。

样例

输入格式 1

2 3

输出格式 1

8

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.