This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <algorithm>
#include <iostream>
using namespace std;
typedef long long ll;
pair<ll, ll>arr[1000006];
int main()
{
ll i, n;
cin >> n;
for (i = 0; i < n; i++)
{
cin >> arr[i].first;
arr[i].second = i;
}
sort(arr, arr + n);
ll e = 1;
for (i = 1; i < n; i++)
{
if (arr[i].second < arr[i - 1].second)
e++;
}
cout << e << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |