結果

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

テストケース

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