ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Google Code Jam 2011 개최
    case Computer : 2011. 4. 15. 08:13
    구글 고드잼 

    프로그래밍 실력을 가르는 대회입니다..
    당연히 주최측은 구글!!

    총 6번의 온라인 테스트를 완료하면 본선에 진출할수 있습니다.
    이번 본선은 일본 도쿄의 구글 본사라고 하네요
    날짜는 한국 기준으로 5월 7일 8시 입니다. 첫문제는 24시간동안입니다.

    상금은 1등은 10,000 달러 ;; 좀 적네요..
    그래도 등수안에 들면 영광은 이루 말할수 없겠죠!!

    아래 사이트의 가면 그동안의 대회의 문제를 볼수 있습니다.
    Site : http://code.google.com/codejam

    아래는 작년 첫번째 온라인 테스트 첫번째 문제입니다.
    첫번째 문제는 자격테스트 군요 

    Problem

    The Snapper is a clever little device that, on one side, plugs its input plug into an output socket, and, on the other side, exposes an output socket for plugging in a light or other device.

    When a Snapper is in the ON state and is receiving power from its input plug, then the device connected to its output socket is receiving power as well. When you snap your fingers -- making a clicking sound -- any Snapper receiving power at the time of the snap toggles between the ON and OFF states.

    In hopes of destroying the universe by means of a singularity, I have purchased NSnapper devices and chained them together by plugging the first one into a power socket, the second one into the first one, and so on. The light is plugged into the Nth Snapper.

    Initially, all the Snappers are in the OFF state, so only the first one is receiving power from the socket, and the light is off. I snap my fingers once, which toggles the firstSnapper into the ON state and gives power to the second one. I snap my fingers again, which toggles both Snappers and then promptly cuts power off from the second one, leaving it in the ON state, but with no power. I snap my fingers the third time, which toggles the first Snapper again and gives power to the second one. Now both Snappers are in the ON state, and if my light is plugged into the second Snapper it will be on.

    I keep doing this for hours. Will the light be on or off after I have snapped my fingers Ktimes? The light is on if and only if it's receiving power from the Snapper it's plugged into.

    Input

    The first line of the input gives the number of test cases, TT lines follow. Each one contains two integers, N and K.

    Output

    For each test case, output one line containing "Case #x: y", where x is the case number (starting from 1) and y is either "ON" or "OFF", indicating the state of the light bulb.

    Limits

    1 ≤ T ≤ 10,000.

    Small dataset

    1 ≤ N ≤ 10;
    0 ≤ K ≤ 100;

    Large dataset

    1 ≤ N ≤ 30;
    0 ≤ K ≤ 108;

    Sample


    Input 
     

    Output 
     
    4
    1 0
    1 1
    4 0
    4 47
    Case #1: OFF
    Case #2: ON
    Case #3: OFF
    Case #4: ON

     
    반응형

    댓글

Designed by Tistory.