結果

問題 No.487 2017 Calculation(2017の計算)
ユーザー taktak
提出日時 2019-07-04 15:47:16
言語 F#
(.NET 7)
結果
AC  
実行時間 62 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 6,827 ms
コンパイル使用メモリ 190,968 KB
実行使用メモリ 30,972 KB
最終ジャッジ日時 2023-10-19 07:38:40
合計ジャッジ時間 8,757 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
30,972 KB
testcase_01 AC 61 ms
30,972 KB
testcase_02 AC 61 ms
30,972 KB
testcase_03 AC 61 ms
30,972 KB
testcase_04 AC 60 ms
30,972 KB
testcase_05 AC 60 ms
30,972 KB
testcase_06 AC 60 ms
30,972 KB
testcase_07 AC 60 ms
30,972 KB
testcase_08 AC 60 ms
30,972 KB
testcase_09 AC 61 ms
30,972 KB
testcase_10 AC 59 ms
30,972 KB
testcase_11 AC 61 ms
30,972 KB
testcase_12 AC 61 ms
30,972 KB
testcase_13 AC 62 ms
30,972 KB
testcase_14 AC 62 ms
30,972 KB
testcase_15 AC 62 ms
30,972 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (238 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 = 2017L

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

let M = int64 <| Console.ReadLine()

solve M
|> Console.WriteLine
0