結果
| 問題 | No.586 ダブルブッキング | 
| コンテスト | |
| ユーザー |  Kaz_nl | 
| 提出日時 | 2017-11-12 17:39:36 | 
| 言語 | C#(csc) (csc 3.9.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 21 ms / 2,000 ms | 
| コード長 | 539 bytes | 
| コンパイル時間 | 712 ms | 
| コンパイル使用メモリ | 107,436 KB | 
| 実行使用メモリ | 25,552 KB | 
| 最終ジャッジ日時 | 2024-11-24 23:15:50 | 
| 合計ジャッジ時間 | 1,322 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 5 | 
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Linq;
class Program
{
    static void Main()
    {
        int ans = 0;
        int[] room = new int[1000];
        int p1 = int.Parse(Console.ReadLine());
        int p2 = int.Parse(Console.ReadLine());
        int n = int.Parse(Console.ReadLine());
        for (int i = 0; i < n; i++)
        {
            int r = int.Parse(Console.ReadLine());
            if (room[r] != 0)
            {
                ans += p1 + p2;
            }
            room[r]++;
        }
        Console.WriteLine(ans);
    }
}
            
            
            
        