# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
924639 | iMeAndMyself | Global Warming (NOI13_gw) | C++14 | 270 ms | 17440 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;
int main()
{
int n,i,vf=0,it=0;
cin>>n;
ll v[n+1];
for(i=1; i<=n; i++)
cin>>v[i];
v[0]=0, v[n+1]=0;
for(i=1; i<=n; i++)
if(v[i]>v[i-1]&&v[i]>=v[i+1]||v[i]>=v[i-1]&&v[i]>v[i+1])
vf++;
for(i=2; i<n; i++)
if(v[i]<v[i-1]&&v[i]<=v[i+1]||v[i]<=v[i-1]&&v[i]<v[i+1])
it++;
cout<<vf;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |