結果
| 問題 |
No.1063 ルートの計算 / Sqrt Calculation
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-21 01:25:22 |
| 言語 | OCaml (5.2.1) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 235 bytes |
| コンパイル時間 | 364 ms |
| コンパイル使用メモリ | 21,576 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-09 01:32:30 |
| 合計ジャッジ時間 | 1,160 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
Scanf.scanf "%d" (fun n ->
let rec loop i a b =
if i * i > b then Printf.printf "%d %d\n" a b else
if b mod (i * i) = 0 then loop i (a * i) (b / (i * i))
else loop (i + 1) a b
in
loop 2 1 n
)