답안 #43895

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
43895 2018-03-27T07:08:28 Z dhkim0225 비교 (balkan11_cmp) C++14
0 / 100
2 ms 248 KB
#include "cmp.h"
#include <iostream>

using namespace std;
void remember(int n) {
	bit_set(n);
}

int compare(int b) {
	for (int i = 1; i < 20239; i++) {
		if (bit_get(i) == '1') {
			if (b < i) 
				return -1;
			else if (b == i) 
				return 0;
			else 
				return 1;
		}
	}
}

Compilation message

cmp.cpp: In function 'int compare(int)':
cmp.cpp:20:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 248 KB ZERO POINTS: bit_set with addr out of range 0