Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
6838 柯宇希 找错误 C++ Wrong Answer 0 MS 264 KB 449 2025-03-22 11:38:58

Tests(0/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,a[50010],s=0; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; if(a[i]<a[i-1]||a[i]>a[i+1]){ s++; } } cout<<s<<endl; return 0; }


Run Info:

------Input------
5 10 52 121 46 97
------Answer-----
2
------Your output-----
5