Submission #28655

# Submission time Handle Problem Language Result Execution time Memory
28655 2017-07-16T08:27:01 Z 핑응핑응 홍신정(#1134, owlur, elxmakdldj, haro199) Bulb Game (FXCUP2_bulb) C
0 / 1
0 ms 1132 KB
#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);
		}
	}
}

Compilation message

bulb.c: In function 'MakeTurn':
bulb.c:20:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1132 KB Output isn't correct
2 Halted 0 ms 0 KB -