結果
| 問題 | No.1185 完全な3の倍数 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-31 15:17:22 |
| 言語 | F# (F# 10.0) |
| 結果 |
AC
|
| 実行時間 | 273 ms / 2,000 ms |
| コード長 | 436 bytes |
| 記録 | |
| コンパイル時間 | 9,258 ms |
| コンパイル使用メモリ | 209,920 KB |
| 実行使用メモリ | 36,980 KB |
| 最終ジャッジ日時 | 2026-04-26 11:00:31 |
| 合計ジャッジ時間 | 23,435 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 39 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (186 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net10.0/main.dll main -> /home/judge/data/code/bin/Release/net10.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"