Submission #221423

# Submission time Handle Problem Language Result Execution time Memory
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;
             ~~~~~^~
# Verdict Execution time Memory Grader output
1 Correct 26 ms 1280 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 1280 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 1280 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 770 ms 24592 KB Output is partially correct - alpha = 0.068965517241