結果

問題 No.5 数字のブロック
ユーザー chike_pluschike_plus
提出日時 2019-03-18 22:52:26
言語 F#
(F# 4.0)
結果
AC  
実行時間 79 ms / 5,000 ms
コード長 343 bytes
コンパイル時間 5,056 ms
コンパイル使用メモリ 164,896 KB
実行使用メモリ 25,848 KB
最終ジャッジ日時 2023-08-11 18:57:26
合計ジャッジ時間 7,241 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
22,368 KB
testcase_01 AC 62 ms
20,388 KB
testcase_02 AC 58 ms
22,340 KB
testcase_03 AC 76 ms
23,280 KB
testcase_04 AC 73 ms
21,172 KB
testcase_05 AC 76 ms
23,588 KB
testcase_06 AC 74 ms
23,288 KB
testcase_07 AC 73 ms
23,000 KB
testcase_08 AC 76 ms
25,248 KB
testcase_09 AC 73 ms
24,936 KB
testcase_10 AC 79 ms
25,848 KB
testcase_11 AC 73 ms
23,060 KB
testcase_12 AC 75 ms
23,372 KB
testcase_13 AC 77 ms
23,560 KB
testcase_14 AC 63 ms
22,240 KB
testcase_15 AC 72 ms
22,488 KB
testcase_16 AC 78 ms
23,544 KB
testcase_17 AC 78 ms
23,804 KB
testcase_18 AC 79 ms
23,408 KB
testcase_19 AC 78 ms
23,884 KB
testcase_20 AC 62 ms
24,360 KB
testcase_21 AC 64 ms
22,416 KB
testcase_22 AC 63 ms
22,312 KB
testcase_23 AC 62 ms
22,352 KB
testcase_24 AC 72 ms
22,572 KB
testcase_25 AC 72 ms
22,548 KB
testcase_26 AC 62 ms
22,224 KB
testcase_27 AC 64 ms
22,312 KB
testcase_28 AC 59 ms
22,240 KB
testcase_29 AC 76 ms
25,164 KB
testcase_30 AC 74 ms
22,836 KB
testcase_31 AC 58 ms
22,232 KB
testcase_32 AC 58 ms
24,408 KB
testcase_33 AC 57 ms
22,364 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 Wn2 do 
  sum <- sum + num
  if ( sum <= L ) then i <- i + 1

Console.WriteLine i
0