結果

問題 No.449 ゆきこーだーの雨と雪 (4)
ユーザー くれちーくれちー
提出日時 2016-11-19 16:48:11
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 3,244 bytes
コンパイル時間 5,439 ms
コンパイル使用メモリ 111,876 KB
実行使用メモリ 24,460 KB
最終ジャッジ日時 2023-10-23 15:55:06
合計ジャッジ時間 13,713 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
24,400 KB
testcase_01 AC 29 ms
24,460 KB
testcase_02 AC 27 ms
24,364 KB
testcase_03 AC 40 ms
24,456 KB
testcase_04 AC 38 ms
24,460 KB
testcase_05 AC 40 ms
24,460 KB
testcase_06 AC 36 ms
24,460 KB
testcase_07 AC 39 ms
24,460 KB
testcase_08 AC 37 ms
24,460 KB
testcase_09 AC 39 ms
24,460 KB
testcase_10 AC 35 ms
24,460 KB
testcase_11 AC 38 ms
24,456 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

class Problem
{
    public char Name { get; set; }
    public int Level { get; set; }
    public int Solve { get; set; } = 0;

    public Problem(int level)
    {
        Level = level;
    }

    public static int GetId(char name)
    {
        return name - 'A';
    }
}

class Submit
{
    public string Name { get; set; }
    public char ProblemName { get; set; }

    public Submit(string name, char problemName)
    {
        Name = name;
        ProblemName = problemName;
    }
}

class Participant : IEquatable<Participant>, IComparable<Participant>
{
    public string Name { get; set; }
    public List<int> Score { get; set; }
    public int ScoreSum { get; set; } = 0;
    public int LastSubmit { get; set; }

    public Participant(string name)
    {
        Name = name;
    }
    public Participant(string name, int problemNum, int lastSubmit)
    {
        Name = name;
        Score = new List<int>();
        for (int i = 0; i < problemNum; i++) Score.Add(0);
        LastSubmit = lastSubmit;
    }

    bool IEquatable<Participant>.Equals(Participant p)
    {
        if (p == null) return false;
        else return (Name == p.Name);
    }

    public int CompareTo(Participant p)
    {
        if (ScoreSum.CompareTo(p.ScoreSum) == 0)
            return LastSubmit.CompareTo(p.LastSubmit);
        else
            return p.ScoreSum.CompareTo(ScoreSum);
    }

    public void Solve(int no, int level, int rank)
    {
        Score[no] = 50 * level + (500 * level / (8 + 2 * rank));
        ScoreSum += Score[no];
    }
}

class Program
{
    static void Main()
    {
        int N = int.Parse(Console.ReadLine());
        var problemList = new List<Problem>(N);

        string[] strtmp = Console.ReadLine().Split(' ');
        for (int i = 0; i < N; i++)
            problemList.Add(new Problem(int.Parse(strtmp[i])));

        int T = int.Parse(Console.ReadLine());
        var submitList = new List<Submit>(T);
        var participantList = new List<Participant>();

        int cntSubmit = 0;
        for (int i = 0; i < T; i++)
        {
            strtmp = Console.ReadLine().Split(' ');

            if (strtmp[1] == "?")
            {
                participantList.Sort();
                Console.WriteLine(participantList.IndexOf(new Participant(strtmp[0])) + 1);
            }
            else
            {
                submitList.Add(new Submit(strtmp[0], char.Parse(strtmp[1])));

                if (!participantList.Contains(new Participant(submitList[cntSubmit].Name)))
                    participantList.Add(new Participant(submitList[cntSubmit].Name, N, cntSubmit));

                int tmpProblemNo =
                    Problem.GetId(submitList[cntSubmit].ProblemName);
                int tmpParticipantNo =
                    participantList.IndexOf(new Participant(submitList[cntSubmit].Name));

                problemList[tmpProblemNo].Solve++;
                participantList[tmpParticipantNo].Solve(
                    tmpProblemNo, problemList[tmpProblemNo].Level, problemList[tmpProblemNo].Solve);
                participantList[tmpParticipantNo].LastSubmit = cntSubmit;

                cntSubmit++;
            }
        }
    }
}
0