Skip to content

Instantly share code, notes, and snippets.

@estelabn
Created April 23, 2023 20:30
Show Gist options
  • Save estelabn/9b164a53cb5ef0e3732e5385d36a3e4e to your computer and use it in GitHub Desktop.
Save estelabn/9b164a53cb5ef0e3732e5385d36a3e4e to your computer and use it in GitHub Desktop.
#include <bits/stdc++.h>
using namespace std;
int main(){
int n; cin >> n;
vector<int> v;
v.push_back(0);
for(int i = 0; i<n; i++) {
int a; cin >> a;
v.push_back(a);
}
char res = 'S';
sort(v.begin(),v.end());
for(int i=0; i<n; i++){
int p = v[i+1], q = v[i];
if(p - q > 8) res = 'N';
}
cout << res << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment