結果

問題 No.2774 Wake up Record 2
ユーザー 👑 kakel-sankakel-san
提出日時 2024-06-07 21:27:44
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 893 bytes
コンパイル時間 8,211 ms
コンパイル使用メモリ 167,608 KB
実行使用メモリ 200,744 KB
最終ジャッジ日時 2024-06-07 21:28:01
合計ジャッジ時間 9,608 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
31,104 KB
testcase_01 AC 59 ms
31,208 KB
testcase_02 AC 57 ms
31,104 KB
testcase_03 AC 58 ms
31,204 KB
testcase_04 AC 56 ms
31,232 KB
testcase_05 AC 56 ms
31,104 KB
testcase_06 AC 55 ms
31,104 KB
testcase_07 AC 57 ms
31,104 KB
testcase_08 AC 59 ms
31,224 KB
testcase_09 AC 61 ms
31,616 KB
testcase_10 AC 60 ms
31,232 KB
testcase_11 AC 74 ms
36,864 KB
testcase_12 AC 71 ms
34,416 KB
testcase_13 AC 94 ms
43,008 KB
testcase_14 AC 94 ms
51,368 KB
testcase_15 AC 98 ms
46,592 KB
testcase_16 AC 93 ms
51,104 KB
testcase_17 AC 96 ms
47,872 KB
testcase_18 AC 86 ms
200,744 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (94 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/

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static int NN => int.Parse(ReadLine());
    static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var c = NList;
        var (n, k) = (c[0], c[1]);
        var a = NList;
        var list = new List<(int id, int ai)>();
        for (var i = 0; i < a.Length; ++i) list.Add((i, a[i]));
        list.Sort((l, r) => l.ai.CompareTo(r.ai));
        var issleep = new bool[n];
        for (var i = 0; i < k; ++i) issleep[list[i].id] = true;
        var ans = new List<int>();
        for (var i = 1; i < n; ++i) if (issleep[i - 1] && !issleep[i]) ans.Add(i + 1);
        WriteLine(ans.Count);
        WriteLine(string.Join(" ", ans));
    }
}
0