結果

問題 No.5 数字のブロック
ユーザー chike_pluschike_plus
提出日時 2019-03-18 22:48:52
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 342 bytes
コンパイル時間 4,850 ms
コンパイル使用メモリ 160,404 KB
実行使用メモリ 27,444 KB
最終ジャッジ日時 2023-09-26 12:43:11
合計ジャッジ時間 8,933 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
22,344 KB
testcase_01 WA -
testcase_02 AC 59 ms
22,296 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 63 ms
22,280 KB
testcase_21 AC 63 ms
22,276 KB
testcase_22 AC 62 ms
22,292 KB
testcase_23 AC 63 ms
22,392 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 62 ms
22,272 KB
testcase_27 AC 64 ms
22,280 KB
testcase_28 AC 58 ms
22,288 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 57 ms
22,288 KB
testcase_32 AC 58 ms
24,400 KB
testcase_33 AC 58 ms
20,352 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System

let L = Console.ReadLine() |> int
let N = Console.ReadLine() |> int
let Wn= Console.ReadLine().Split(' ')
        |> Array.map (fun i -> i |> int )
        |> Array.toList

let Wn2 = Wn |> List.sort
let mutable sum = 0
let mutable i = 0

for num in Wn do 
  sum <- sum + num
  if ( sum <= L ) then i <- i + 1

Console.WriteLine i
0