답안 #982280

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
982280 2024-05-14T05:41:28 Z Vedang1006 커다란 상품 (IOI17_prize) C++14
20 / 100
1 ms 600 KB
#include "prize.h"

int find_best(int n) {
	int i = 0;

	for (int jumpSize = 30; jumpSize >= 0; jumpSize--)
	{
		if (i + (1<<jumpSize) < n && ask(i + (1<<jumpSize))[1] == 1) i += (1<<jumpSize);
	}
	
	if (ask(i)[1] == 1) return i + 1;
	else return i;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 1 ms 596 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 600 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Incorrect 0 ms 596 KB answer is not correct
12 Halted 0 ms 0 KB -