#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
444 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
444 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
444 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
444 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |