結果
| 問題 | No.167 N^M mod 10 |
| コンテスト | |
| ユーザー |
nobigomu
|
| 提出日時 | 2018-05-31 17:36:37 |
| 言語 | F# (F# 10.0) |
| 結果 |
AC
|
| 実行時間 | 73 ms / 1,000 ms |
| コード長 | 279 bytes |
| 記録 | |
| コンパイル時間 | 7,180 ms |
| コンパイル使用メモリ | 214,880 KB |
| 実行使用メモリ | 31,744 KB |
| 最終ジャッジ日時 | 2026-04-10 07:09:47 |
| 合計ジャッジ時間 | 9,742 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 27 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (229 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net10.0/main.dll main -> /home/judge/data/code/bin/Release/net10.0/publish/
ソースコード
let f n = fun (s:string) -> if s.Length=1 then s.[0..] else s.[s.Length-n..]
match ((stdin.ReadLine >> f 1)(),(stdin.ReadLine >> f 2)()) with
| (_,"0") -> 1
| ("0",_) -> 0
| (n,m) -> (pown (int n) ((int >> fun n -> if n%4=0 then 4 else n%4) m))%10
|> stdout.WriteLine
nobigomu