結果
| 問題 | 
                            No.192 合成数
                             | 
                    
| コンテスト | |
| ユーザー | 
                             kashiwagi513
                         | 
                    
| 提出日時 | 2019-03-01 01:51:09 | 
| 言語 | OCaml  (5.2.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 319 bytes | 
| コンパイル時間 | 270 ms | 
| コンパイル使用メモリ | 19,824 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-10-09 00:33:44 | 
| 合計ジャッジ時間 | 2,148 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 21 WA * 4 | 
ソースコード
let is_solution m =
  let rec inner n =
    if m mod n = 0 then true
    else if n = 1 then false
    else inner (n - 1)
  in inner (m-1)
let solve n = 
  let rec inner m =
    if is_solution m then m
    else inner m - 1
  in print_int @@ inner (n + 100)
let _ =
  let n = int_of_string @@ read_line () in
  solve n
            
            
            
        
            
kashiwagi513