답안 #221423

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
221423 2020-04-10T03:34:13 Z t12345 Hotter Colder (IOI10_hottercolder) C++14
77 / 100
770 ms 24592 KB
#include "grader.h"

int HC(int N) {
	int lt=1, rt=N, md, x;
	while(lt < rt) {
		x = Guess(lt);
		x = Guess(rt);
		md = lt+rt >> 1;
		if(x==0) return md;
		else if(x==1) lt = md+1;
		else rt = lt+rt-1 >> 1;
	}
	return lt;
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:8:10: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   md = lt+rt >> 1;
        ~~^~~
hottercolder.cpp:11:18: warning: suggest parentheses around '-' inside '>>' [-Wparentheses]
   else rt = lt+rt-1 >> 1;
             ~~~~~^~
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 1280 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 1280 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 1280 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 770 ms 24592 KB Output is partially correct - alpha = 0.068965517241