Start: Jul, 10, 2019 08:30:00
2019年度暑期短学期达标测试补考
End: Jul, 10, 2019 11:30:00
Time elapsed:
Time remaining:

Problem_ID: E
Result: Accepted
Time: 40ms
Memory: 1120kB
Author: 2018212212056
In contest: 1284

#include <stdio.h>
#include <string.h>
#include<stdbool.h>
int f[50],n;
bool find();
int main() {
	f[0]=2;
	f[1]=3;
	for(int i=2; i<24; i++){
		f[i]=f[i-1]+f[i-2];
	}
	while(scanf("%d",&n)!=EOF){
		if(find()){
			printf("Lucky Day\n");
		}
		else{
			printf("Bad Day\n");
		}
	}
}
bool find(){
	int l=0,r=23,mid;
	while(l<=r){
		mid=(l+r)>>1;
		if(n==f[mid]){
			return true;
		}
		else if(n<f[mid]){
			r=mid-1;
		}
		else{
			l=mid+1;
		}
	}
	return false;
}