提出 #76114482


ソースコード 拡げる

using System.Diagnostics;
class Program
{
    static string ReadLine() => Console.ReadLine().Trim();
    static int ReadInt() => int.Parse(ReadLine());
    static long ReadLong() => long.Parse(ReadLine());
    static int[] ReadIntArray() { string str = ReadLine(); return str != "" ? str.Split().Select(_ => int.Parse(_)).ToArray() : new int[0]; }
    static long[] ReadLongArray() { string str = ReadLine(); return str != "" ? str.Split().Select(_ => long.Parse(_)).ToArray() : new long[0]; }
    static (int, int) ReadInt2() { int[] vs = ReadIntArray(); return (vs[0], vs[1]); }
    static (int, int, int) ReadInt3() { int[] vs = ReadIntArray(); return (vs[0], vs[1], vs[2]); }
    static (int, int, int, int) ReadInt4() { int[] vs = ReadIntArray(); return (vs[0], vs[1], vs[2], vs[3]); }
    static (int, int, int, int, int) ReadInt5() { int[] vs = ReadIntArray(); return (vs[0], vs[1], vs[2], vs[3], vs[4]); }
    static (long, long) ReadLong2() { long[] vs = ReadLongArray(); return (vs[0], vs[1]); }

    static void Main()
    {
        SourceExpander.Expander.Expand();

        int max = 10 * 100000;

        (int N, int Q) = ReadInt2();
        int[] A = new int[N];
        int[] counts = new int[max];

        int cur = 0;
        for (int i = 0; i < Q; i++)
        {
            (int t, int x) = ReadInt2();
            if (t == 1)
            {
                x--;
                A[x]++;
                counts[A[x]]++;
                if (counts[A[x]] == N)
                    cur++;
            }
            if (t == 2)
            {
                int ans = counts[x + cur];
                Console.WriteLine(ans);
                //Console.WriteLine($"cur: {cur}");
                //Console.WriteLine(string.Join(", ", counts));
            }
        }
    }
}
#region Expanded by https://github.com/kzrnm/SourceExpander
namespace SourceExpander{public class Expander{[Conditional("EXP")]public static void Expand(string inputFilePath=null,string outputFilePath=null,bool ignoreAnyError=true){}public static string ExpandString(string inputFilePath=null,bool ignoreAnyError=true){return "";}}}
#endregion Expanded by https://github.com/kzrnm/SourceExpander

提出情報

提出日時
問題 C - Drop Blocks
ユーザ hatodemowakaru
言語 C# 13.0 (.NET Native AOT 9.0.8)
得点 300
コード長 2233 Byte
結果 AC
実行時間 302 ms
メモリ 7172 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 1
AC × 50
セット名 テストケース
Sample example_00.txt
All example_00.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, hand_12.txt, hand_13.txt, hand_14.txt, hand_15.txt, hand_16.txt, hand_17.txt, hand_18.txt, hand_19.txt, hand_20.txt, hand_21.txt, hand_22.txt, hand_23.txt, hand_24.txt, hand_25.txt, hand_26.txt, hand_27.txt, hand_28.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt
ケース名 結果 実行時間 メモリ
example_00.txt AC 1 ms 3600 KiB
hand_00.txt AC 43 ms 7020 KiB
hand_01.txt AC 42 ms 7104 KiB
hand_02.txt AC 295 ms 5948 KiB
hand_03.txt AC 293 ms 5944 KiB
hand_04.txt AC 175 ms 6776 KiB
hand_05.txt AC 171 ms 6076 KiB
hand_06.txt AC 169 ms 5964 KiB
hand_07.txt AC 30 ms 7148 KiB
hand_08.txt AC 300 ms 5976 KiB
hand_09.txt AC 169 ms 6408 KiB
hand_10.txt AC 171 ms 6216 KiB
hand_11.txt AC 32 ms 7136 KiB
hand_12.txt AC 31 ms 6976 KiB
hand_13.txt AC 302 ms 5976 KiB
hand_14.txt AC 173 ms 6628 KiB
hand_15.txt AC 172 ms 6144 KiB
hand_16.txt AC 1 ms 3516 KiB
hand_17.txt AC 302 ms 5840 KiB
hand_18.txt AC 30 ms 7160 KiB
hand_19.txt AC 30 ms 7128 KiB
hand_20.txt AC 29 ms 7112 KiB
hand_21.txt AC 175 ms 7104 KiB
hand_22.txt AC 43 ms 7172 KiB
hand_23.txt AC 295 ms 6516 KiB
hand_24.txt AC 275 ms 6984 KiB
hand_25.txt AC 1 ms 3636 KiB
hand_26.txt AC 1 ms 3496 KiB
hand_27.txt AC 21 ms 7112 KiB
hand_28.txt AC 122 ms 6312 KiB
random_00.txt AC 157 ms 6536 KiB
random_01.txt AC 204 ms 5948 KiB
random_02.txt AC 186 ms 5904 KiB
random_03.txt AC 227 ms 5904 KiB
random_04.txt AC 239 ms 6188 KiB
random_05.txt AC 222 ms 6152 KiB
random_06.txt AC 101 ms 6124 KiB
random_07.txt AC 228 ms 5976 KiB
random_08.txt AC 134 ms 5976 KiB
random_09.txt AC 148 ms 5960 KiB
random_10.txt AC 226 ms 5956 KiB
random_11.txt AC 106 ms 5916 KiB
random_12.txt AC 249 ms 5976 KiB
random_13.txt AC 193 ms 5800 KiB
random_14.txt AC 150 ms 6096 KiB
random_15.txt AC 99 ms 6772 KiB
random_16.txt AC 249 ms 5936 KiB
random_17.txt AC 127 ms 6708 KiB
random_18.txt AC 155 ms 5972 KiB
random_19.txt AC 160 ms 6128 KiB