joj1063

 1063: A Funny Game


Result
TIME Limit
MEMORY Limit
Run Times
AC Times
JUDGE
3s
8192K
696
260
Standard
1st JOJ Cup Online VContest Warmup Problem
Tom and Jack are on the train. The journey is too dull so much so that both of them are eager to find a way to fritter away the time. Tom is a student of mathematics department. He proposes a funny game to play with Jack. First pile up N chips where 1

Input Specification


The input consists of several lines, each of which consists of an integer N. The last line of the input is 0, which you shouldn't process.

Output Specification


For each N, you should output either YES or NO. If there exists a win-strategy for Jack, output YES. Otherwise output NO.

Sample Input

2
3
4
5
1000
0

Sample Output

NO
NO
YES
NO
YES

Submit / Problem List / Status / Discuss
#include #include #include using namespace std; int f[100000]={0}; int main() {     memset(f,0,sizeof(f));     int v=2;     int u=3;     f[2]=1;     f[3]=1;     while(u<=100000&&v<=100000)     {         f[u]=1;         int temp=u+v;         v=u;         u=temp;     }    //for(int i=1;i<=19;i++)cout<이것은 피보나치의 수열과 바둑의 응용에 대한 상세한 상황입니다. 제 블로그에 옮겨진 피보나치가 돌을 뽑아서 바둑을 하는 것을 볼 수 있습니다.

좋은 웹페이지 즐겨찾기