結果
問題 | No.16 累乗の加算 |
ユーザー | tak |
提出日時 | 2018-04-13 23:08:38 |
言語 | F# (F# 4.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 342 bytes |
コンパイル時間 | 4,277 ms |
コンパイル使用メモリ | 156,760 KB |
実行使用メモリ | 23,944 KB |
最終ジャッジ日時 | 2023-09-09 04:47:02 |
合計ジャッジ時間 | 6,441 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 113 ms
23,884 KB |
testcase_01 | AC | 114 ms
23,944 KB |
testcase_02 | RE | - |
testcase_03 | RE | - |
testcase_04 | RE | - |
testcase_05 | RE | - |
testcase_06 | RE | - |
testcase_07 | RE | - |
testcase_08 | RE | - |
testcase_09 | RE | - |
testcase_10 | RE | - |
testcase_11 | RE | - |
testcase_12 | RE | - |
testcase_13 | RE | - |
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0 Copyright (c) Microsoft Corporation. All Rights Reserved.
ソースコード
let modVal = 1000003 let genPowModSeq n = Seq.unfold(fun x -> Some(x,x*n%modVal)) 1 let x,N = let t = stdin.ReadLine().Split() |> Array.map(int) in t.[0],t.[1] let a = stdin.ReadLine().Split() |> Array.map(int) let pows = genPowModSeq x |> Seq.take 105 |> Seq.toArray let ans = a |> Array.sumBy(fun x -> pows.[x]) ans |> printfn "%A"