码迷,mamicode.com
首页 > 移动开发 > 详细

【小米oj】 优秀数字

时间:2019-05-05 20:46:15      阅读:226      评论:0      收藏:0      [点我收藏+]

标签:ret   clu   inf   play   none   return   set   typedef   name   

#define mm(a) memset(a,0,sizeof(a));
#define max(x,y) (x)>(y)?(x):(y)
#define min(x,y) (x)<(y)?(x):(y)
#define Fopen freopen("1.in","r",stdin); freopen("m.out","w",stdout);
#define rep(i,a,b) for(ll i=(a);i<=(b);i++)
#define per(i,b,a) for(ll i=(b);i>=(a);i--)
#include<bits/stdc++.h>
typedef long long ll;
#define PII pair<ll,ll>
using namespace std;
const int INF=0x3f3f3f3f;
const int MAXN=(int)2e6+5;

ll n;
bool ck1(ll n) {
    ll x=1;
    n--;
    for(int i=1; i<=63; i++) {
        if(n==x)return 1;
        x<<=1;
    }
    return 0;
}
bool ck2(ll n) {
    ll x=1;
    n++;
    for(int i=1; i<=63; i++) {
        if(n==x)return 1;
        x<<=1;
    }
    return 0;
}
int main() {
    while(~scanf("%lld",&n)) {
        int ok1=ck1(n);
        int ok2=ck2(n);
        if(ok1&&ok2)printf("Very Good\n");
        else if(ok1&&!ok2)printf("Good\n");
        else if(!ok1&&ok2)printf("Bad\n");
        else printf("Normal\n");
    }
    return 0;
}

 

#define mm(a) memset(a,0,sizeof(a));#define max(x,y) (x)>(y)?(x):(y) #define min(x,y) (x)<(y)?(x):(y) #define Fopen freopen("1.in","r",stdin);freopen("m.out","w",stdout);#define rep(i,a,b) for(ll i=(a);i<=(b);i++) #define per(i,b,a) for(ll i=(b);i>=(a);i--) #include<bits/stdc++.h> typedef long long ll; #define PII pair<ll,ll> using namespace std; const int INF=0x3f3f3f3f; const int MAXN=(int)2e6+5; ll n; bool ck1(ll n) {     ll x=1;     n--;     for(int i=1; i<=63; i++) {         if(n==x)return 1;         x<<=1;     }     return 0; } bool ck2(ll n) {     ll x=1;     n++;     for(int i=1; i<=63; i++) {         if(n==x)return 1;         x<<=1;     }     return 0; } int main() {     while(~scanf("%lld",&n)) {         int ok1=ck1(n);         int ok2=ck2(n);         if(ok1&&ok2)printf("Very Good\n");         else if(ok1&&!ok2)printf("Good\n");         else if(!ok1&&ok2)printf("Bad\n");         else printf("Normal\n");     }     return 0; }
技术图片
#define mm(a)memset(a,0,sizeof(a)); #define max(x,y)(x)>(y)?(x):( y)#define min(x,y)(x)<(y)?(x):( y)#define Fopen freopen ( “1.in”, “R”,标准输入); freopen函数( “m.out”, “W”,标准输出); #define rep(i,a,b)for(ll i =(a); i <=(b); i ++)#define per(i,b,a)for(ll i =(b); i> = (一);我 - )
的#include <比特/ STDC ++。H>
typedef long long ll;
#define PII对<ll,ll> using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN =(int)2e6 + 5;

ll n;
bool ck1(ll n){
    ll x = 1;
    N--;
    for(int i = 1; i <= 63; i ++){
        if(n == x)返回1;
        X << = 1;
    }
    返回0;
}
bool ck2(ll n){
    ll x = 1;
    的n ++;
    for(int i = 1; i <= 63; i ++){
        if(n == x)返回1;
        X << = 1;
    }
    返回0;
}
int main(){
    while(~scanf(“%lld”,&n)){
        int ok1 = ck1(n);
        int ok2 = ck2(n);
        if(ok1 && ok2)printf(“Very Good \ n”);
        否则if(ok1 &&!ok2)printf(“Good \ n”);
        否则if(!ok1 && ok2)printf(“Bad \ n”);
        else printf(“Normal \ n”);
    }
    返回0;
}

【小米oj】 优秀数字

标签:ret   clu   inf   play   none   return   set   typedef   name   

原文地址:https://www.cnblogs.com/dogenya/p/10816045.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!