結果

問題 No.1046 Fruits Rush
ユーザー keymoonkeymoon
提出日時 2020-05-08 21:20:52
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 623 bytes
コンパイル時間 2,051 ms
コンパイル使用メモリ 103,708 KB
実行使用メモリ 24,016 KB
最終ジャッジ日時 2023-09-17 00:44:17
合計ジャッジ時間 3,840 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
21,868 KB
testcase_01 AC 60 ms
21,888 KB
testcase_02 AC 58 ms
21,888 KB
testcase_03 AC 60 ms
23,972 KB
testcase_04 AC 58 ms
19,876 KB
testcase_05 AC 58 ms
23,828 KB
testcase_06 AC 57 ms
21,884 KB
testcase_07 AC 59 ms
19,836 KB
testcase_08 AC 57 ms
23,976 KB
testcase_09 AC 57 ms
21,980 KB
testcase_10 AC 57 ms
23,948 KB
testcase_11 AC 57 ms
21,836 KB
testcase_12 AC 57 ms
22,060 KB
testcase_13 AC 57 ms
21,856 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
public static class P
{
    public static void Main()
    {
        var nk = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var n = nk[0];
        var k = nk[1];
        var a = Console.ReadLine().Split().Select(int.Parse).ToArray();
        Console.WriteLine(a.OrderByDescending(x => x).TakeWhile(x => x >= 0).Take(k).Sum());
    }
}
0