結果

問題 No.2092 Conjugation
ユーザー bluemeganebluemegane
提出日時 2022-10-08 06:53:59
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 692 bytes
コンパイル時間 2,372 ms
コンパイル使用メモリ 65,604 KB
実行使用メモリ 39,392 KB
最終ジャッジ日時 2023-09-04 04:18:41
合計ジャッジ時間 6,763 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
23,444 KB
testcase_01 AC 67 ms
23,660 KB
testcase_02 AC 66 ms
23,444 KB
testcase_03 AC 67 ms
19,416 KB
testcase_04 AC 67 ms
21,468 KB
testcase_05 AC 67 ms
23,432 KB
testcase_06 AC 67 ms
23,384 KB
testcase_07 AC 80 ms
22,868 KB
testcase_08 AC 116 ms
36,016 KB
testcase_09 AC 102 ms
27,916 KB
testcase_10 AC 106 ms
33,544 KB
testcase_11 AC 107 ms
33,804 KB
testcase_12 AC 101 ms
27,840 KB
testcase_13 AC 96 ms
28,852 KB
testcase_14 AC 95 ms
28,552 KB
testcase_15 AC 102 ms
29,800 KB
testcase_16 AC 124 ms
36,264 KB
testcase_17 AC 135 ms
38,976 KB
testcase_18 AC 127 ms
39,392 KB
testcase_19 AC 93 ms
26,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Hello
{
    static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = Array.ConvertAll(line, long.Parse);
        getAns(n, a);
    }
    static void getAns(int n, long[] a)
    {
        var b = new int[100001];
        foreach (var x in a) b[x]++;
        var ans = new long[a[0]];
        var s = b.Sum();
        ans[0] = s;
        for (int i = 1; i < a[0]; i++)
        {
            ans[i] = ans[i - 1] - b[i];
        }
        Console.WriteLine(string.Join(" ", ans));
    }
}
0