Skip to content

Instantly share code, notes, and snippets.

@joaogui1
Last active June 25, 2017 20:05
Show Gist options
  • Save joaogui1/4a08d84896ca00c38d810d1b68b4e6ae to your computer and use it in GitHub Desktop.
Save joaogui1/4a08d84896ca00c38d810d1b68b4e6ae to your computer and use it in GitHub Desktop.
#include <bits/stdc++.h>
using namespace std;
int v[1024];
int main(){
int n;
cin >> n;
for(int i = 1; i <= n; ++i){
cin >> v[i];
}
for(int i = 2; i <= n - 1; ++i){
if(v[i] < v[i - 1] && v[i] < v[i + 1]){
printf("S\n");
return 0;
}
}
printf("N\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment