# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
382814 | Sashuk_keshuk | Po (COCI21_po) | C++14 | 25 ms | 2156 KiB |
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 <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 228;
int n, a[N], b[N], n2;
int main(){
cin.tie(0); cout.tie(0); iostream::sync_with_stdio(false); ios_base::sync_with_stdio(false);
cin >> n;
n2 = 0;
for (int i = 1; i <= n; i++) {cin >> b[i]; if (b[i] != b[i - 1]) {n2++; a[n2] = b[i];}}
a[0] = 0;
int kol = 0;
int kol2 = 0;
for (int i = 1; i <= n2; i++) cout << a[i] << ' '; cout << '\n';
for (int i = 0; i <= n2; i++){
if (a[i] < a[i + 1]) kol++;
}
/*a[0] = 999;
for (int i = n2 + 1; i >= 1; i--){
if (a[i] < a[i - 1]) kol++;
}*/
cout << kol;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |