結果

問題 No.1185 完全な3の倍数
ユーザー natoriusannatoriusan
提出日時 2023-07-31 15:17:22
言語 F#
(F# 4.0)
結果
AC  
実行時間 338 ms / 2,000 ms
コード長 436 bytes
コンパイル時間 11,385 ms
コンパイル使用メモリ 193,996 KB
実行使用メモリ 34,876 KB
最終ジャッジ日時 2024-04-18 15:18:57
合計ジャッジ時間 26,532 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 322 ms
34,484 KB
testcase_01 AC 324 ms
34,216 KB
testcase_02 AC 322 ms
34,620 KB
testcase_03 AC 321 ms
34,724 KB
testcase_04 AC 320 ms
33,596 KB
testcase_05 AC 326 ms
34,064 KB
testcase_06 AC 338 ms
34,860 KB
testcase_07 AC 321 ms
33,816 KB
testcase_08 AC 321 ms
34,492 KB
testcase_09 AC 322 ms
34,596 KB
testcase_10 AC 317 ms
34,344 KB
testcase_11 AC 324 ms
34,348 KB
testcase_12 AC 319 ms
34,348 KB
testcase_13 AC 321 ms
34,212 KB
testcase_14 AC 323 ms
34,072 KB
testcase_15 AC 318 ms
34,356 KB
testcase_16 AC 322 ms
34,608 KB
testcase_17 AC 324 ms
34,460 KB
testcase_18 AC 323 ms
34,344 KB
testcase_19 AC 325 ms
34,068 KB
testcase_20 AC 326 ms
34,876 KB
testcase_21 AC 324 ms
34,576 KB
testcase_22 AC 327 ms
34,620 KB
testcase_23 AC 319 ms
33,680 KB
testcase_24 AC 316 ms
34,652 KB
testcase_25 AC 325 ms
34,492 KB
testcase_26 AC 321 ms
34,496 KB
testcase_27 AC 321 ms
33,600 KB
testcase_28 AC 316 ms
34,748 KB
testcase_29 AC 326 ms
33,916 KB
testcase_30 AC 319 ms
34,576 KB
testcase_31 AC 319 ms
34,484 KB
testcase_32 AC 320 ms
34,492 KB
testcase_33 AC 323 ms
33,940 KB
testcase_34 AC 315 ms
33,592 KB
testcase_35 AC 316 ms
34,052 KB
testcase_36 AC 322 ms
33,724 KB
testcase_37 AC 322 ms
34,200 KB
testcase_38 AC 327 ms
34,876 KB
testcase_39 AC 320 ms
34,344 KB
testcase_40 AC 321 ms
34,048 KB
testcase_41 AC 322 ms
33,812 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (519 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

let n = stdin.ReadLine ()

let rec count (n: string) =
    if n.Length = 1 then
        (n.[0] |> string |> int) / 3 + 1
    elif (n.[0] |> string |> int) % 3 = 0 then
        ((n.[0] |> string |> int) / 3) * (4. ** (float n.Length - 1.) |> int) + count n.[1..]
    else
        ((n.[0] |> string |> int) / 3 + 1) * (4. ** (float n.Length - 1.) |> int)
        
if n.Length = 2 then ((int n)-9) / 3 else count n + 14
    |> printfn "%d"
0