結果
問題 |
No.167 N^M mod 10
|
ユーザー |
![]() |
提出日時 | 2015-04-26 11:23:47 |
言語 | D (dmd 2.109.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 251 bytes |
コンパイル時間 | 708 ms |
コンパイル使用メモリ | 99,588 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-12 02:36:15 |
合計ジャッジ時間 | 1,576 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 RE * 12 |
ソースコード
import std.array, std.stdio, std.string, std.algorithm, std.conv; void main() { long N = readln.strip.to!long % 10; long M = readln.strip.to!long; if (M == 0) writeln(1); else { writeln(N ^^ ((M - 1) % 4 + 1) % 10); } }