結果

問題 No.487 2017 Calculation(2017の計算)
ユーザー taktak
提出日時 2019-07-04 15:46:13
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 307 bytes
コンパイル時間 6,815 ms
コンパイル使用メモリ 189,760 KB
実行使用メモリ 30,808 KB
最終ジャッジ日時 2023-10-19 07:38:24
合計ジャッジ時間 9,188 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
30,788 KB
testcase_01 AC 62 ms
30,808 KB
testcase_02 AC 63 ms
30,808 KB
testcase_03 AC 62 ms
30,808 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 63 ms
30,788 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 63 ms
30,788 KB
testcase_12 WA -
testcase_13 AC 62 ms
30,788 KB
testcase_14 WA -
testcase_15 AC 63 ms
30,788 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (241 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

module Yuki

open System

let [<Literal>] YEAR = 2017

let solve m =
    let square = YEAR * YEAR
    let rec f acc =
        function
        | 1 -> (acc * square) % m
        | n -> f ((acc * square) % m) (n - 1)
    (2017 + (f 1 2017)) % m

let M = int <| Console.ReadLine()

solve M
|> Console.WriteLine
0