Submission #166915

#TimeUsernameProblemLanguageResultExecution timeMemory
166915apostoldaniel854Money (IZhO17_money)C++14
0 / 100
2 ms376 KiB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
#define pb push_back
#define dbg(x) cerr << #x << " " << x << "\n"

const int N = 1e6;

int a[1 + N], pos[1 + N];
int in_use[1 + N];

int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    int ans = 1;
    priority_queue <int> pq;
    for (int i = 1; i < n; i++)
        if (a[i] > a[i + 1])
            ans++;
    cout << ans << "\n";
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...