시간복잡도에 유의하여 풀이해야 한다. 인덱스 배열을 만들어 해결했다. #include using namespace std;int M;int S[22];int main() { cin.tie(NULL); ios::sync_with_stdio(false); cin >> M; string inputoper; int input; for (int i = 0; i > inputoper; if (inputoper == "add") { cin >> input; if (!S[input]) S[input] = 1; } else if (inputoper == "remove") { ..