답안 #311762

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
311762 2020-10-11T13:52:50 Z kaplanbar Baloni (COCI15_baloni) C++14
10 / 100
1626 ms 42336 KB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr int N = 1e6+5;
int n;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> n;
    map<int,set<int>> v;
    for(int i = 0; i < n; i++) {
      int x;
      cin >> x;
      v[-x].insert(i);
    }
    int c = 0;
    for(auto &x : v) {
      if(x.second.empty()) continue;
      c++;
      int now = -x.first;
      int pos = -1;
      while(v[-now].upper_bound(pos) != v[-now].end()) {
        int x = *v[-now].upper_bound(pos);
        pos = x;
        v[-now].erase(pos);
        now--;
      }
    }
    cout << c << "\n";
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 512 KB Output isn't correct
2 Incorrect 2 ms 512 KB Output isn't correct
3 Incorrect 8 ms 640 KB Output isn't correct
4 Incorrect 3 ms 640 KB Output isn't correct
5 Correct 1626 ms 37880 KB Output is correct
6 Incorrect 1330 ms 42336 KB Output isn't correct
7 Incorrect 974 ms 34936 KB Output isn't correct
8 Incorrect 1014 ms 34424 KB Output isn't correct
9 Incorrect 1250 ms 36492 KB Output isn't correct
10 Incorrect 1174 ms 37680 KB Output isn't correct