Submission #534652

# Submission time Handle Problem Language Result Execution time Memory
534652 2022-03-08T13:00:11 Z andecaandeci Money (IZhO17_money) C++17
0 / 100
1 ms 296 KB
#include <bits/stdc++.h>
#define REP(v, i, j) for (int v = i; v != j; v++)
#define FORI(v) for (auto i : v)
#define FORJ(v) for (auto j : v)

#define OUT(v, a)     FORI(v)           cout << i << a;
#define OUTS(v, a, b)          cout << v.size() << a;     OUT(v, b)
#define in(a, n)     REP(i, 0, n)     cin >> a[i];

#define SORT(v) sort(begin(v), end(v))
#define REV(v) reverse(begin(v), end(v))

#define pb push_back
#define fi first
#define se second

#define detachIO                          ios_base::sync_with_stdio(false);     cin.tie(0);                           cout.tie(0);

using namespace std;

typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef pair<pii, pii> piiii;

set<int> st;
vector<int> v;

int main()
{
    detachIO;

    int N;
    cin >> N;

    while (N--)
    {
        int x;
        cin >> x;
        if (st.lower_bound(x) != st.end())
            v.pb(*st.lower_bound(x));
        else
            v.pb(1E8);
        st.insert(x);
    }

    cout << unique(v.begin(), v.end()) - v.begin() << '\n';
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Incorrect 1 ms 204 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Incorrect 1 ms 204 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Incorrect 1 ms 204 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Incorrect 1 ms 204 KB Output isn't correct
5 Halted 0 ms 0 KB -