結果

問題 No.167 N^M mod 10
ユーザー RinRin
提出日時 2015-09-12 10:43:09
言語 Scheme
(Gauche-0.9.14)
結果
RE  
実行時間 -
コード長 395 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 5,072 KB
実行使用メモリ 13,184 KB
最終ジャッジ日時 2023-09-26 11:37:17
合計ジャッジ時間 5,057 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
11,856 KB
testcase_01 AC 19 ms
11,668 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 AC 21 ms
12,512 KB
testcase_05 AC 31 ms
11,804 KB
testcase_06 AC 18 ms
11,848 KB
testcase_07 AC 19 ms
11,860 KB
testcase_08 AC 19 ms
11,672 KB
testcase_09 AC 19 ms
11,712 KB
testcase_10 AC 19 ms
11,900 KB
testcase_11 AC 19 ms
11,656 KB
testcase_12 AC 19 ms
11,748 KB
testcase_13 AC 19 ms
11,676 KB
testcase_14 AC 19 ms
11,652 KB
testcase_15 AC 20 ms
11,948 KB
testcase_16 AC 19 ms
11,736 KB
testcase_17 AC 19 ms
11,744 KB
testcase_18 TLE -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (System.out.println x)
  (begin
    (display x)
    (newline)
  )
)

(let (
      (N (modulo (read) 10))
      (M (read))
     )
  (if (= M 0)
      (System.out.println 1)
      (let (
            (foo (modulo M 12))
           )
        (if (= foo 0)
            (System.out.println (modulo (expt N 4) 10))
            (System.out.println (modulo (expt N M) 10))
        )
      )
  )
)
0