結果

問題 No.714 回転寿司屋のシミュレート
ユーザー bluemeganebluemegane
提出日時 2018-09-24 19:23:20
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 54 ms / 2,000 ms
コード長 1,150 bytes
コンパイル時間 3,886 ms
コンパイル使用メモリ 109,644 KB
実行使用メモリ 24,996 KB
最終ジャッジ日時 2023-10-23 23:18:45
合計ジャッジ時間 4,169 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
24,992 KB
testcase_01 AC 27 ms
24,988 KB
testcase_02 AC 28 ms
24,996 KB
testcase_03 AC 28 ms
24,988 KB
testcase_04 AC 29 ms
24,996 KB
testcase_05 AC 32 ms
24,996 KB
testcase_06 AC 36 ms
24,996 KB
testcase_07 AC 42 ms
24,988 KB
testcase_08 AC 54 ms
24,988 KB
testcase_09 AC 35 ms
24,996 KB
testcase_10 AC 33 ms
24,996 KB
testcase_11 AC 36 ms
24,992 KB
testcase_12 AC 33 ms
24,992 KB
testcase_13 AC 34 ms
24,996 KB
testcase_14 AC 34 ms
24,996 KB
testcase_15 AC 34 ms
24,988 KB
testcase_16 AC 35 ms
24,996 KB
testcase_17 AC 32 ms
24,988 KB
testcase_18 AC 34 ms
24,996 KB
testcase_19 AC 34 ms
24,988 KB
testcase_20 AC 34 ms
24,988 KB
testcase_21 AC 34 ms
24,988 KB
testcase_22 AC 30 ms
24,988 KB
testcase_23 AC 30 ms
24,988 KB
testcase_24 AC 31 ms
24,996 KB
testcase_25 AC 29 ms
24,996 KB
testcase_26 AC 31 ms
24,992 KB
testcase_27 AC 29 ms
24,980 KB
testcase_28 AC 30 ms
24,996 KB
testcase_29 AC 30 ms
24,996 KB
testcase_30 AC 26 ms
24,996 KB
testcase_31 AC 27 ms
24,932 KB
testcase_32 AC 27 ms
24,932 KB
testcase_33 AC 27 ms
24,932 KB
testcase_34 AC 27 ms
24,932 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System.Linq;
using System.Collections.Generic;
using System;

public class Hello
{
    public static void Main()
    {
        var c = new List<string>[20];
        for (int i = 0; i < 20; i++) c[i] = new List<string>();
        var n = int.Parse(Console.ReadLine().Trim());
        for (int i = 0; i < n; i++)
        {
            string[] line = Console.ReadLine().Trim().Split(' ');
            if (line[0] == "0")
            {
                var n1 = int.Parse(line[1]) - 1;
                var m1 = int.Parse(line[2]);
                for (int j = 0; j < m1; j++)
                    c[n1].Add(line[j + 3]);
            }
            else if (line[0] == "1")
            {
                var neta = line[1];
                var deleted = false;
                for (int j = 0; j < 20; j++)
                    if (c[j].Count() > 0 && c[j].Contains(neta)) { c[j].Remove(neta); deleted = true; Console.WriteLine(j + 1); break; }
                if (!deleted) Console.WriteLine(-1);
            }
            else
            {
                var a = int.Parse(line[1]) - 1;
                c[a].Clear();
            }
        }
    }
}
0