結果
問題 | No.167 N^M mod 10 |
ユーザー |
![]() |
提出日時 | 2015-04-04 19:11:35 |
言語 | Ruby (3.4.1) |
結果 |
RE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 343 bytes |
コンパイル時間 | 191 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,544 KB |
最終ジャッジ日時 | 2024-09-22 01:13:31 |
合計ジャッジ時間 | 3,700 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 2 |
other | RE * 27 |
コンパイルメッセージ
Syntax OK
ソースコード
class FixnumMOD = 10def power(x)result = 1n = selfwhile x > 0result = (result * n) % MOD if (x & 1).nonzero?n = (n * n) % MODx >>= 1endresultendendclass Yukicoderdef initializen = gets.chomp.to_im = gets.chomp.to_iputs n.power(m) % 10endendYukicoder.new