結果

問題 No.504 ゲーム大会(ランキング)
ユーザー ooh_20ooh_20
提出日時 2017-05-29 11:21:57
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 925 bytes
コンパイル時間 844 ms
コンパイル使用メモリ 106,928 KB
実行使用メモリ 28,304 KB
最終ジャッジ日時 2023-10-21 16:49:42
合計ジャッジ時間 4,868 ms
ジャッジサーバーID
(参考情報)
judge12 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
28,304 KB
testcase_01 AC 25 ms
23,956 KB
testcase_02 AC 25 ms
23,956 KB
testcase_03 AC 25 ms
23,940 KB
testcase_04 AC 25 ms
23,956 KB
testcase_05 AC 24 ms
23,940 KB
testcase_06 AC 23 ms
23,920 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

namespace No._504
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int K = 0;
            var rank = new List<int>();

            K = int.Parse(Console.ReadLine());
            rank.Add(K);
            Console.WriteLine(1);

            for (int i = 1; i < N; i++)
            {
                int buf = int.Parse(Console.ReadLine());

                for (int j = 0; j < rank.Count; j++)
                {
                    if (buf > rank[j])
                    {
                        rank.Insert(j, buf);
                        break;
                    }
                }

                if (rank.Count < i + 1)
                {
                    rank.Add(buf);
                }

                Console.WriteLine(rank.IndexOf(K) + 1);
            }
        }
    }
}
0