提出 #56538165


ソースコード 拡げる

// I AM A MUSLIM

#include "bits/stdc++.h"

#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")

#define fastIO std::ios::sync_with_stdio(0);std::cin.tie(0)
#define ll long long int
#define flush fflush(stdout)
#define bl printf("\n")
#define yn(a, b) printf("%s\n", a >= b ? "Yes":"No")
// #define int ll

using pii = std::pair<int,int>;

const int MOD = 1000000007;
// const int MOD = 998244353;
const int mxN = 100100;

signed main() {
	// fastIO;
	int testCases=1;
	// scanf("%d",&testCases);
	// std::cin >> testCases;
	
	for (int TC = 1; TC <= testCases; TC++) {
		int N;
        scanf("%d",&N);
        std::map<int,int> ans;
        for (int i = 0, ty, x; i < N; i++) {
            scanf("%d",&ty);
            if (ty == 3) {
                printf("%d\n", (int)ans.size());
                continue;
            }
            scanf("%d",&x);
            if (ty == 1) ans[x]++;
            else {
                ans[x]--;
                if (ans[x] == 0) ans.erase(x);
            }
        }
		
	}
	
	return 0;
}

/*

*/

提出情報

提出日時
問題 C - Balls and Bag Query
ユーザ MArhamAA1422
言語 C++ 20 (Clang 16.0.6)
得点 300
コード長 1118 Byte
結果 AC
実行時間 104 ms
メモリ 12216 KiB

コンパイルエラー

./Main.cpp:5:13: warning: unknown pragma ignored [-Wunknown-pragmas]
#pragma GCC optimize("O3,unroll-loops")
            ^
./Main.cpp:6:13: warning: unknown pragma ignored [-Wunknown-pragmas]
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
            ^
./Main.cpp:17:11: warning: unused variable 'MOD' [-Wunused-const-variable]
const int MOD = 1000000007;
          ^
./Main.cpp:19:11: warning: unused variable 'mxN' [-Wunused-const-variable]
const int mxN = 100100;
          ^
4 warnings generated.

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 2
AC × 25
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt
All 00_sample_00.txt, 00_sample_01.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 3608 KiB
00_sample_01.txt AC 1 ms 3684 KiB
01_random_00.txt AC 69 ms 9512 KiB
01_random_01.txt AC 67 ms 9680 KiB
01_random_02.txt AC 69 ms 9500 KiB
01_random_03.txt AC 68 ms 9624 KiB
01_random_04.txt AC 69 ms 9464 KiB
01_random_05.txt AC 70 ms 10060 KiB
01_random_06.txt AC 69 ms 9864 KiB
01_random_07.txt AC 72 ms 9856 KiB
01_random_08.txt AC 70 ms 9896 KiB
01_random_09.txt AC 73 ms 9896 KiB
01_random_10.txt AC 30 ms 3640 KiB
01_random_11.txt AC 30 ms 3780 KiB
01_random_12.txt AC 35 ms 3688 KiB
01_random_13.txt AC 34 ms 3728 KiB
01_random_14.txt AC 37 ms 3872 KiB
01_random_15.txt AC 37 ms 3820 KiB
01_random_16.txt AC 42 ms 4100 KiB
01_random_17.txt AC 42 ms 4152 KiB
01_random_18.txt AC 104 ms 12216 KiB
01_random_19.txt AC 53 ms 8100 KiB
01_random_20.txt AC 73 ms 8092 KiB
01_random_21.txt AC 73 ms 8240 KiB
01_random_22.txt AC 73 ms 8280 KiB