답안 #384622

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
384622 2021-04-01T22:52:53 Z vulpes Baloni (COCI15_baloni) C++17
100 / 100
349 ms 4076 KB
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int r = 0, n; cin >> n;
    multiset<int> x;
    while (n--) {
        int a; cin >> a;
        if (x.find(a) != x.end()) {
            x.erase(x.find(a));
        }
        else {
            r++;
        }
        x.insert(a - 1);
    }
    cout << r << endl;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 512 KB Output is correct
2 Correct 2 ms 364 KB Output is correct
3 Correct 3 ms 492 KB Output is correct
4 Correct 3 ms 492 KB Output is correct
5 Correct 290 ms 4076 KB Output is correct
6 Correct 349 ms 4076 KB Output is correct
7 Correct 286 ms 3308 KB Output is correct
8 Correct 278 ms 3308 KB Output is correct
9 Correct 289 ms 3692 KB Output is correct
10 Correct 306 ms 3564 KB Output is correct