結果

問題 No.1724 [Cherry 3rd Tune A] Lápiz labial de Sonia
ユーザー bluemeganebluemegane
提出日時 2021-10-30 09:21:22
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 329 ms / 2,000 ms
コード長 855 bytes
コンパイル時間 1,033 ms
コンパイル使用メモリ 110,264 KB
実行使用メモリ 68,184 KB
最終ジャッジ日時 2024-04-16 16:13:43
合計ジャッジ時間 13,812 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
19,456 KB
testcase_01 AC 32 ms
19,328 KB
testcase_02 AC 32 ms
19,328 KB
testcase_03 AC 28 ms
19,200 KB
testcase_04 AC 32 ms
19,072 KB
testcase_05 AC 31 ms
19,072 KB
testcase_06 AC 32 ms
19,200 KB
testcase_07 AC 32 ms
19,328 KB
testcase_08 AC 33 ms
19,200 KB
testcase_09 AC 32 ms
19,200 KB
testcase_10 AC 33 ms
19,328 KB
testcase_11 AC 36 ms
19,840 KB
testcase_12 AC 37 ms
19,584 KB
testcase_13 AC 37 ms
19,712 KB
testcase_14 AC 37 ms
19,712 KB
testcase_15 AC 37 ms
19,712 KB
testcase_16 AC 185 ms
46,976 KB
testcase_17 AC 293 ms
62,012 KB
testcase_18 AC 184 ms
56,200 KB
testcase_19 AC 109 ms
39,084 KB
testcase_20 AC 124 ms
40,236 KB
testcase_21 AC 326 ms
68,184 KB
testcase_22 AC 251 ms
66,136 KB
testcase_23 AC 329 ms
65,904 KB
testcase_24 AC 271 ms
65,880 KB
testcase_25 AC 266 ms
63,972 KB
testcase_26 AC 325 ms
63,984 KB
testcase_27 AC 317 ms
64,132 KB
testcase_28 AC 264 ms
64,244 KB
testcase_29 AC 316 ms
63,868 KB
testcase_30 AC 327 ms
63,984 KB
testcase_31 AC 223 ms
64,124 KB
testcase_32 AC 276 ms
63,984 KB
testcase_33 AC 286 ms
63,996 KB
testcase_34 AC 274 ms
59,784 KB
testcase_35 AC 274 ms
63,980 KB
testcase_36 AC 31 ms
19,072 KB
testcase_37 AC 29 ms
19,072 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System.Linq;
using System;

public class P
{
    public int amb { get; set; }
    public int id { get; set; }
}

public class Hello
{
    static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = int.Parse(line[0]);
        var k = int.Parse(line[1]);
        line = Console.ReadLine().Trim().Split(' ');
        string[] line2 = Console.ReadLine().Trim().Split(' ');
        var ps = new P[n];
        for (int i = 0; i < n; i++)
            ps[i] = new P { id = i, amb = int.Parse(line[i]) - int.Parse(line2[i]) };
        getAns(n, k, ps);
    }
    static void getAns(int n, int k, P[] ps)
    {
        var ans = Enumerable.Repeat('B', n).ToArray();
        foreach (var x in ps.OrderByDescending(x => x.amb).Take(k))
            ans[x.id] = 'A';
        Console.WriteLine(new string(ans));
    }
}
0