# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
523277 | tato | Po (COCI21_po) | C++14 | 77 ms | 5540 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>
#define ll long long
using namespace std;
map <int,int> mp;
void answer()
{
int n;
cin >> n;
int a[n + 1];
for(int i = 1; i <= n; i++)
cin >> a[i];
int cnt = 1;
mp[a[1]] = 1;
for(int i = 2; i <= n; i++)
if(a[i] > a[i-1] or mp[a[i]] == 0)
{
cnt++;
mp[a[i]] = 1;
}
else
mp[a[i]] = 1;
cout << cnt;
}
int main()
{
int t = 1;
//cin >> t;
while(t--)
answer();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |