Submission #877858

#TimeUsernameProblemLanguageResultExecution timeMemory
877858auslanderMoney (IZhO17_money)C++17
0 / 100
0 ms444 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...