Current work

This commit is contained in:
2026-08-03 19:03:58 +01:00
parent b48299efb7
commit a79ff12290
46 changed files with 1345 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
freopen("outofplace.in", "r", stdin);
size_t n;
cin >> n;
vector<int> heights(n);
for (int &height : heights) {
cin >> height;
}
vector<int> sortedHeights(heights);
sort(sortedHeights.begin(), sortedHeights.end());
int bad = 0;
for (int i = 0; i < n; i++) {
if (sortedHeights[i] != heights[i]) {
bad++;
}
}
freopen("outofplace.out", "w", stdout);
cout << bad - 1;
return 0;
}