Submission #28348

# Submission time Handle Problem Language Result Execution time Memory
28348 2017-07-16T04:54:47 Z 볼빨간 승관이(#1152, sys7961, deneb2016, hyorothy) Bulb Game (FXCUP2_bulb) C++11
0 / 1
0 ms 1128 KB
#include <cstdio>
#include <cstring>
bool haha[1005];
int Num;
void Init(int N)
{
    memset(haha, 0, sizeof(haha));
    Num = N;
}
int MakeTurn(int M)
{
    int tcnt = 0, fcnt = 0, maxidx = 0, maxv = -987654321;
    for(int i = M; i < Num; ++i) {
        if(haha[i])
            tcnt++;
        else
            fcnt++;
        if(maxv < fcnt - tcnt) {
            maxv = fcnt - tcnt;
            maxidx = i;
        }
    }
    for(int i = M; i <= maxidx; ++i)
        haha[i] = !haha[i];
    return maxidx + 1;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1128 KB Output is correct
2 Incorrect 0 ms 1128 KB Output isn't correct
3 Halted 0 ms 0 KB -