Download uva_cpp_clean/10038/10038-3.cpp from slayone/uva_spoj_raw: direct link, hf CLI and curl.
- Browser
- Download file 750 Bytes
-
https://huggingface.co/datasets/slayone/uva_spoj_raw/resolve/main/uva_cpp_clean/10038/10038-3.cpp
- Command line
-
hf download hf://datasets/slayone/uva_spoj_raw/uva_cpp_clean/10038/10038-3.cpp
-
curl -L -o 10038-3.cpp https://huggingface.co/datasets/slayone/uva_spoj_raw/resolve/main/uva_cpp_clean/10038/10038-3.cpp
750 Bytes
| using namespace std; | |
| bitset<3000> boolFlag(0); | |
| int inputArray[3000]; | |
| int main () | |
| { | |
| int N, tempInt; | |
| bool jolly; | |
| while ( scanf("%d",&N) != EOF ) | |
| { | |
| jolly = true; | |
| boolFlag.reset(); | |
| // Reading input: | |
| for ( int l = 0; l < N; l++ ) | |
| scanf ("%d", &inputArray[l] ); | |
| // Flaging values passed: | |
| for ( int i = 1; i < N; i++ ) | |
| { | |
| tempInt = abs(inputArray[i-1]-inputArray[i]); | |
| if ( tempInt > (N -1) || tempInt == 0 ) | |
| { | |
| jolly = false; | |
| break; | |
| } | |
| boolFlag [tempInt] = true; | |
| } | |
| // Checking if the requirements are met: | |
| if ( jolly && boolFlag.count() == N-1 ) | |
| printf ("Jolly\n"); | |
| else | |
| printf("Not jolly\n"); | |
| } | |
| } | |