結果
問題 | No.167 N^M mod 10 |
ユーザー |
![]() |
提出日時 | 2015-04-26 11:31:55 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 6 ms / 1,000 ms |
コード長 | 277 bytes |
コンパイル時間 | 1,089 ms |
コンパイル使用メモリ | 106,112 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-12 02:36:37 |
合計ジャッジ時間 | 2,054 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 27 |
ソースコード
import std.array, std.stdio, std.string, std.algorithm, std.conv;import std.bigint;void main(){BigInt N = readln.strip().to!BigInt;BigInt M = readln.strip().to!BigInt;if (M == 0) writeln(1);else {writeln(N ^^ ((M - 1) % 4 + 1) % 10);}}