제출 #28655

#제출 시각아이디문제언어결과실행 시간메모리
28655핑응핑응 홍신정 (#68)Bulb Game (FXCUP2_bulb)C11
0 / 1
0 ms1132 KiB
#include "bulb.h"

int button[1111];
int NN;
void Init(int N) {
	// do nothing
	NN = N;
}

int MakeTurn(int M) {
	button[M] = 1;
	for (int i = 2; i <= NN+1; i*=2) {
		if (button[(M + i) % (NN + 1)] == 0) {
			button[(M + i) % (NN + 1)] = 1;
			if ((M + i) % (NN + 1) == 0)
				return 1;
			return (M + i) % (NN + 1);
		}
	}
}

컴파일 시 표준 에러 (stderr) 메시지

bulb.c: In function 'MakeTurn':
bulb.c:20:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...