結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー claw88claw88
提出日時 2016-10-15 11:18:17
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 392 ms / 4,000 ms
コード長 1,554 bytes
コンパイル時間 5,003 ms
コンパイル使用メモリ 105,384 KB
実行使用メモリ 46,020 KB
最終ジャッジ日時 2023-08-14 13:50:59
合計ジャッジ時間 20,197 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 380 ms
46,020 KB
testcase_01 AC 381 ms
43,852 KB
testcase_02 AC 377 ms
41,992 KB
testcase_03 AC 385 ms
43,856 KB
testcase_04 AC 378 ms
41,860 KB
testcase_05 AC 377 ms
45,876 KB
testcase_06 AC 392 ms
41,776 KB
testcase_07 AC 375 ms
43,844 KB
testcase_08 AC 383 ms
43,896 KB
testcase_09 AC 381 ms
44,064 KB
testcase_10 AC 370 ms
41,936 KB
testcase_11 AC 376 ms
41,964 KB
testcase_12 AC 372 ms
43,896 KB
testcase_13 AC 369 ms
41,980 KB
testcase_14 AC 367 ms
43,908 KB
testcase_15 AC 350 ms
41,884 KB
testcase_16 AC 374 ms
43,932 KB
testcase_17 AC 375 ms
43,984 KB
testcase_18 AC 377 ms
39,744 KB
testcase_19 AC 368 ms
39,936 KB
testcase_20 AC 371 ms
43,964 KB
testcase_21 AC 364 ms
43,796 KB
testcase_22 AC 370 ms
43,844 KB
testcase_23 AC 374 ms
43,792 KB
testcase_24 AC 363 ms
41,800 KB
testcase_25 AC 371 ms
41,932 KB
testcase_26 AC 368 ms
43,888 KB
testcase_27 AC 369 ms
43,912 KB
testcase_28 AC 367 ms
43,840 KB
testcase_29 AC 368 ms
43,904 KB
testcase_30 AC 68 ms
22,880 KB
testcase_31 AC 68 ms
25,064 KB
testcase_32 AC 376 ms
39,800 KB
testcase_33 AC 376 ms
43,912 KB
testcase_34 AC 376 ms
43,876 KB
testcase_35 AC 69 ms
25,032 KB
testcase_36 AC 67 ms
22,984 KB
testcase_37 AC 69 ms
23,208 KB
testcase_38 AC 68 ms
23,232 KB
testcase_39 AC 72 ms
25,172 KB
testcase_40 AC 70 ms
23,152 KB
testcase_41 AC 95 ms
28,796 KB
testcase_42 AC 94 ms
28,748 KB
testcase_43 AC 93 ms
28,864 KB
testcase_44 AC 94 ms
30,776 KB
testcase_45 AC 70 ms
23,208 KB
testcase_46 AC 97 ms
30,892 KB
testcase_47 AC 98 ms
28,976 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