結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー claw88claw88
提出日時 2016-10-15 11:18:17
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 470 ms / 4,000 ms
コード長 1,554 bytes
コンパイル時間 1,171 ms
コンパイル使用メモリ 108,544 KB
実行使用メモリ 39,552 KB
最終ジャッジ日時 2024-05-02 02:00:07
合計ジャッジ時間 16,874 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 359 ms
39,040 KB
testcase_01 AC 352 ms
39,424 KB
testcase_02 AC 354 ms
39,552 KB
testcase_03 AC 364 ms
39,296 KB
testcase_04 AC 358 ms
39,168 KB
testcase_05 AC 359 ms
39,424 KB
testcase_06 AC 373 ms
39,296 KB
testcase_07 AC 355 ms
39,296 KB
testcase_08 AC 365 ms
39,168 KB
testcase_09 AC 363 ms
39,040 KB
testcase_10 AC 369 ms
39,040 KB
testcase_11 AC 366 ms
39,424 KB
testcase_12 AC 357 ms
39,296 KB
testcase_13 AC 351 ms
39,296 KB
testcase_14 AC 353 ms
39,296 KB
testcase_15 AC 335 ms
39,168 KB
testcase_16 AC 352 ms
39,040 KB
testcase_17 AC 359 ms
39,168 KB
testcase_18 AC 364 ms
39,296 KB
testcase_19 AC 350 ms
39,424 KB
testcase_20 AC 345 ms
39,168 KB
testcase_21 AC 354 ms
39,296 KB
testcase_22 AC 360 ms
39,296 KB
testcase_23 AC 363 ms
39,168 KB
testcase_24 AC 356 ms
39,296 KB
testcase_25 AC 470 ms
39,168 KB
testcase_26 AC 350 ms
39,296 KB
testcase_27 AC 355 ms
39,424 KB
testcase_28 AC 352 ms
39,168 KB
testcase_29 AC 347 ms
39,296 KB
testcase_30 AC 34 ms
20,608 KB
testcase_31 AC 34 ms
20,608 KB
testcase_32 AC 353 ms
39,296 KB
testcase_33 AC 364 ms
39,296 KB
testcase_34 AC 365 ms
39,040 KB
testcase_35 AC 34 ms
20,864 KB
testcase_36 AC 35 ms
20,864 KB
testcase_37 AC 35 ms
20,992 KB
testcase_38 AC 36 ms
20,864 KB
testcase_39 AC 38 ms
21,376 KB
testcase_40 AC 38 ms
21,504 KB
testcase_41 AC 64 ms
26,624 KB
testcase_42 AC 66 ms
26,496 KB
testcase_43 AC 63 ms
26,368 KB
testcase_44 AC 64 ms
26,240 KB
testcase_45 AC 38 ms
21,120 KB
testcase_46 AC 66 ms
26,624 KB
testcase_47 AC 67 ms
26,360 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Generic;
using System.Linq;
using System.Text;

//大学内順位をつけることで順位をパラメタとしてソートしたりデキューしたりできる!!

namespace yuki_433
{
    class Program
    {
        static int N, K;
        static HashSet<Team> L = new HashSet<Team>();
        static int[] C = new int[100001];

        static void Main(string[] args)
        {
            var sb = new StringBuilder();
            var t = scan;
            N = t[0]; K = t[1];


            for (int i = 0; i < N; i++)
            {
                t = scan;
                L.Add(new Team(i, t[0], t[1], t[2]));
            }

            var A = L.OrderByDescending(l => l.S).ThenBy(l => l.P).ToArray();

            foreach (var a in A)
            {
                a.Urank = C[a.U];
                C[a.U]++;
            }

            A = A.OrderByDescending(l => l.S).ThenBy(l =>l.Urank).ThenBy(l => l.P).ToArray();

            for (int i = 0; i < K; i++)
            {
                sb.AppendLine(A[i].Num.ToString());
            }

            Console.Write(sb);

        }
        class Team
        {
            internal int Num, S, P, U, Urank;
            public Team(int Num, int S, int P, int U)
            {
                this.Num = Num;
                this.S = S;
                this.P = P;
                this.U = U;
                Urank = 0;
            }
        }

        static int[] scan { get { return Array.ConvertAll(Console.ReadLine().Split(), int.Parse); } }
    }
}
0