Created
April 23, 2023 20:30
-
-
Save estelabn/9b164a53cb5ef0e3732e5385d36a3e4e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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