| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1361996 | cholpon1 | Infinite Race (EGOI24_infiniterace2) | C++20 | 52 ms | 11380 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
cin.tie(0)->sync_with_stdio(0);
int n, q;
cin >> n >> q;
vector <int> x(q);
set <int> st;
for (int i = 0; i < q; i++) {
cin >> x[i];
}
int ans = 0;
for (int i = 0; i < q; i++) {
if (x[i] > 0) {
if (st.count(x[i])) {
st.clear();
ans++;
}
st.insert(x[i]);
} else {
st.erase(abs(x[i]));
st.erase(x[i]);
}
}
cout << ans;
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
