結果
| 問題 |
No.167 N^M mod 10
|
| コンテスト | |
| ユーザー |
tsuchinaga
|
| 提出日時 | 2019-03-06 17:19:53 |
| 言語 | Go (1.23.4) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 319 bytes |
| コンパイル時間 | 10,764 ms |
| コンパイル使用メモリ | 223,304 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-23 14:38:07 |
| 合計ジャッジ時間 | 11,747 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 19 WA * 8 |
ソースコード
package main
import (
"fmt"
"math"
)
func main() {
var n, m string
_, _ = fmt.Scan(&n, &m)
if m == "0" {
fmt.Println(1)
} else {
nn := n[len(n)-1] - '0'
mn := m[len(m)-1] - '0'
if len(m) >= 2 {
mn += (m[len(m)-2] - '0') * 10
}
fmt.Println(int(math.Pow(float64(nn), float64((mn+4)%4))) % 10)
}
}
tsuchinaga