結果

問題 No.586 ダブルブッキング
ユーザー mbanmban
提出日時 2017-12-01 17:32:05
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 1,900 bytes
コンパイル時間 2,120 ms
コンパイル使用メモリ 106,848 KB
実行使用メモリ 21,972 KB
最終ジャッジ日時 2023-08-18 15:19:17
合計ジャッジ時間 3,219 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
using System.Threading.Tasks;

class Scanner
{
    private readonly char Separator = ' ';
    private int Index = 0;
    private string[] Line = new string[0];
    public string Next()
    {
        if (Index >= Line.Length)
        {
            Line = Console.ReadLine().Split(Separator);
            Index = 0;
        }
        var ret = Line[Index];
        Index++;
        return ret;
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

    public long NextLong()
    {
        return long.Parse(Next());
    }

    public string[] StringArray()
    {
        Line = Console.ReadLine().Split(Separator);
        Index = Line.Length;
        return Line;
    }

    public int[] IntArray()
    {
        var l = StringArray();
        var res = new int[l.Length];
        for (int i = 0; i < l.Length; i++)
        {
            res[i] = int.Parse(l[i]);
        }
        return res;
    }

    public long[] LongArray()
    {
        var l = StringArray();
        var res = new long[l.Length];
        for (int i = 0; i < l.Length; i++)
        {
            res[i] = long.Parse(l[i]);
        }
        return res;
    }
}
class Program
{
    private int P1, P2, N;
    private int[] R;
    private void Scan()
    {
        var sc = new Scanner();

    }

    public void Solve()
    {
        Scan();
        var map = new Dictionary<int, int>();
        foreach (int i in R)
        {
            int o;
            if (!map.TryGetValue(i, out o))
            {
                o = 0;
            }
            map[i] = o + 1;
        }
        int ans = 0;
        foreach (var i in map)
        {
            ans += (P1 + P2) * (i.Value - 1);
        }
        Console.WriteLine(ans);
    }

    static void Main(string[] args)
    {
        new Program().Solve();
    }
}
0