結果

問題 No.3016 unordered_mapなるたけ落とすマン
ユーザー 14番14番
提出日時 2016-05-22 01:54:17
言語 C#(csc)
(csc 3.9.0)
結果
MLE  
実行時間 -
コード長 2,329 bytes
コンパイル時間 1,151 ms
コンパイル使用メモリ 119,020 KB
実行使用メモリ 67,176 KB
最終ジャッジ日時 2024-04-16 12:03:05
合計ジャッジ時間 16,803 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
25,652 KB
testcase_01 AC 45 ms
25,864 KB
testcase_02 AC 46 ms
25,648 KB
testcase_03 MLE -
testcase_04 MLE -
testcase_05 MLE -
testcase_06 MLE -
testcase_07 MLE -
testcase_08 MLE -
testcase_09 MLE -
testcase_10 MLE -
testcase_11 MLE -
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 MLE -
testcase_16 MLE -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 MLE -
testcase_23 MLE -
testcase_24 MLE -
testcase_25 MLE -
testcase_26 MLE -
testcase_27 MLE -
testcase_28 MLE -
testcase_29 MLE -
testcase_30 MLE -
testcase_31 MLE -
testcase_32 MLE -
testcase_33 MLE -
testcase_34 MLE -
testcase_35 MLE -
testcase_36 MLE -
testcase_37 MLE -
testcase_38 MLE -
testcase_39 MLE -
testcase_40 MLE -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 MLE -
testcase_48 MLE -
testcase_49 MLE -
testcase_50 MLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Text;
using System.Linq;

class Program
{
    public void Proc()
    {
        Reader.IsDebug = false;
        int[] inpt = Reader.ReadLine().Split(' ').Select(a=>int.Parse(a)).ToArray();
        
        long[] aList = Reader.ReadLine().Split(' ').Select(a=>long.Parse(a)).OrderBy(a=>a).ToArray();
        Dictionary<long, int> aCnt = new Dictionary<long, int>();
        aList.ToList().ForEach(a=>{
            if(aCnt.ContainsKey(a)) {
                aCnt[a]++;
            } else
            {
                aCnt.Add(a, 1);
            }
        });
        aList = aCnt.Keys.ToArray();
        
        Dictionary<int, long> bList = new Dictionary<int, long>();
        Reader.ReadLine().Split(' ').Select(a=>long.Parse(a)).ToList().ForEach(b=>bList.Add(bList.Count, b));
        Dictionary<int, int> cList = new Dictionary<int, int>();
        int currentIdx = 0;
        bList.OrderBy(a=>a.Value).ToList().ForEach((a)=>{
            int cnt = 0;
            for(int i=currentIdx; i<aList.Length; i++) {
                currentIdx = i;
                if(aList[i] < a.Value) {
                    // スルー
                } else if(aList[i] == a.Value) {
                    cnt+=aCnt[aList[i]];
                } else
                {
                    break;
                }
            }
            cList[a.Key] = cnt;
        });
        StringBuilder ans = new StringBuilder();
        cList.OrderBy(a=>a.Key).ToList().ForEach(a=>ans.Append(" " + a.Value));
        Console.WriteLine(ans.ToString().Substring(1));
        

    }
    




    

    public class Reader
    {
        public static bool IsDebug = true;
        private static String PlainInput = @"


2 2
0 1000000000000
0 1000000000000


 
";
        private static System.IO.StringReader Sr = null;
        public static string ReadLine()
        {
            if (IsDebug)
            {
                if (Sr == null)
                {
                    Sr = new System.IO.StringReader(PlainInput.Trim());
                }
                return Sr.ReadLine();
            }
            else
            {
                return Console.ReadLine();
            }
        }
    }
    static void Main()
    {
        Program prg = new Program();
        prg.Proc();
    }
}
0