結果
問題 |
No.1185 完全な3の倍数
|
ユーザー |
|
提出日時 | 2023-07-31 15:17:22 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 341 ms / 2,000 ms |
コード長 | 436 bytes |
コンパイル時間 | 11,564 ms |
コンパイル使用メモリ | 185,652 KB |
実行使用メモリ | 35,004 KB |
最終ジャッジ日時 | 2024-10-10 08:34:01 |
合計ジャッジ時間 | 26,997 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 39 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (394 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/
ソースコード
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"