# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
28348 | 볼빨간 승관이 (#68) | Bulb Game (FXCUP2_bulb) | C++11 | 0 ms | 1128 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 |
---|---|---|---|---|
Fetching results... |