結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー guriceringuricerin
提出日時 2020-02-12 15:31:50
言語 F#
(.NET 7)
結果
AC  
実行時間 71 ms / 5,000 ms
コード長 1,303 bytes
コンパイル時間 7,370 ms
コンパイル使用メモリ 164,800 KB
実行使用メモリ 26,176 KB
最終ジャッジ日時 2023-07-27 09:21:46
合計ジャッジ時間 7,370 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
24,140 KB
testcase_01 AC 70 ms
24,248 KB
testcase_02 AC 69 ms
24,116 KB
testcase_03 AC 70 ms
26,176 KB
testcase_04 AC 68 ms
24,256 KB
testcase_05 AC 68 ms
24,064 KB
testcase_06 AC 68 ms
22,096 KB
testcase_07 AC 68 ms
24,088 KB
testcase_08 AC 69 ms
24,184 KB
testcase_09 AC 71 ms
24,092 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

/home/judge/data/code/Main.fs(23,9): warning FS0025: Incomplete pattern matches on this expression. For example, the value '[|_; _; _|]' may indicate a case not covered by the pattern(s).

ソースコード

diff #

open System
open System.Collections.Generic

[<AutoOpen>]
module Cin =
    let read f = stdin.ReadLine() |> f
    let reada f = stdin.ReadLine().Split() |> Array.map f
    let readChars() = read string |> Seq.toArray
    let readInts() = readChars() |> Array.map (fun x -> Convert.ToInt32(x.ToString()))

[<AutoOpen>]
module Cout =
    let writer = new IO.StreamWriter(new IO.BufferedStream(Console.OpenStandardOutput()))
    let print (s: string) = writer.Write s
    let println (s: string) = writer.WriteLine s
    let inline puts (s: ^a) = string s |> println

// -----------------------------------------------------------------------------------------------------

// -----------------------------------------------------------------------------------------------------

let main() =
    let [| p; c |] = reada int

    let psum =
        [ 2; 3; 5; 7; 11; 13 ]
        |> List.sum
        |> fun x -> float x / 6.0

    let csum =
        [ 4; 6; 8; 9; 10; 12 ]
        |> List.sum
        |> fun x -> float x / 6.0

    let mutable ans = 1.0
    for _ in 1 .. p do
        ans <- ans * psum
    for _ in 1 .. c do
        ans <- ans * csum

    ans |> puts

    ()

// -----------------------------------------------------------------------------------------------------
main()
writer.Dispose()
0