-
Notifications
You must be signed in to change notification settings - Fork 5
/
main.cpp
40 lines (33 loc) · 842 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Author : Qi Zhang
// Date : 2018-12-11
#include <bits/stdc++.h>
using namespace std;
bool ispow1(long long val){
double mi = log(double(val)) / log(2);
cout << mi << endl;
if(abs(mi-floor(mi)) < 1e-10) return true;
else return false;
}
bool ispow(long long val){
while(val > 1){
if((val & 0x1) == 1) return false;
val /= 2;
}
return true;
}
int main()
{
string line;
while (getline(cin, line)) {
long long n = stoll(line);
if(n == 0 || n == 1) cout << "Bad" << endl;
else if(n == 2) cout << "Good" << endl;
else if(n == 3) cout << "Very Good" << endl;
else{
if(ispow(n-1)) cout << "Good" << endl;
else if(ispow(n+1)) cout << "Bad" << endl;
else cout << "Normal" << endl;
}
}
return 0;
}