結果
問題 | No.16 累乗の加算 |
ユーザー | tak |
提出日時 | 2018-04-13 23:12:46 |
言語 | F# (F# 4.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 349 bytes |
コンパイル時間 | 4,118 ms |
コンパイル使用メモリ | 154,504 KB |
実行使用メモリ | 559,348 KB |
最終ジャッジ日時 | 2023-09-09 04:47:44 |
合計ジャッジ時間 | 16,075 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | MLE | - |
testcase_01 | -- | - |
testcase_02 | -- | - |
testcase_03 | -- | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
コンパイルメッセージ
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 1000000001 |> Seq.toArray let ans = a |> Array.sumBy(fun x -> pows.[x]) ans |> printfn "%A"