結果
| 問題 | No.231 めぐるはめぐる (1) | 
| コンテスト | |
| ユーザー |  tak | 
| 提出日時 | 2019-02-15 11:08:33 | 
| 言語 | F# (F# 4.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 61 ms / 1,000 ms | 
| コード長 | 714 bytes | 
| コンパイル時間 | 14,118 ms | 
| コンパイル使用メモリ | 191,536 KB | 
| 実行使用メモリ | 29,952 KB | 
| 最終ジャッジ日時 | 2024-09-14 06:35:11 | 
| 合計ジャッジ時間 | 10,375 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 11 | 
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (362 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/
ソースコード
[<Measure>] type h
type Dungeon = { Exp: int</h>; Death: int</h> }
let solve dungeons =
  let dungeon = 
    dungeons
    |> Array.map (fun x -> x.Exp - 30000 * x.Death)
    |> Array.indexed
    |> Array.sortByDescending snd
    |> Array.head
    
  let isEnable = 
    dungeon
    |> snd
    |> fun x -> x * 6<h> >= 30000 * 100
  let dungeons = Array.create 6 (dungeon |> (fst >> (+) 1))
  isEnable, dungeons
let R() = stdin.ReadLine()
let N = R() |> int
let GD = Array.init N (fun _ ->
  let t = R().Split() |> Array.map (int>>(*)1</h>)
  { Exp = t.[0]; Death = t.[1]})
solve GD
|> function 
  | (true, xs) -> 
    stdout.WriteLine "YES"
    xs |> Array.iter stdout.WriteLine
  | _ -> stdout.WriteLine "NO"
            
            
            
        