답안 #1040485

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1040485 2024-08-01T05:56:00 Z 김은성(#10995) How to Avoid Disqualification in 75 Easy Steps (CEOI23_avoid) C++17
5 / 100
1 ms 600 KB
#include "avoid.h"
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;

std::pair<int, int> scout(int R, int H) {
	int i, j, a, b, lo, hi, mid;
	lo = 1, hi = 1000;
	while(lo < hi){
		mid = (lo+hi)/2;
		vector<int> vec;
		for(i=1; i<=mid; i++)
			vec.push_back(i);
		send(vec);
		if(wait()[0])
			hi = mid;
		else
			lo = mid+1;
	}
	a = lo;
	lo++;
	int init = lo;
	hi = 1001;
	while(lo < hi){
		mid = (lo+hi)/2;
		vector<int> vec;
		for(i=init; i<=mid; i++)
			vec.push_back(i);
		send(vec);
		if(wait()[0])
			hi = mid;
		else
			lo = mid+1;
	}
	if(hi == 1001)
		b = a;
	else
		b = lo;
	return make_pair(a, b);
}

Compilation message

avoid.cpp: In function 'std::pair<int, int> scout(int, int)':
avoid.cpp:14:9: warning: unused variable 'j' [-Wunused-variable]
   14 |  int i, j, a, b, lo, hi, mid;
      |         ^
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Correct: 15 robot(s) used, 15 hour(s) passed
2 Correct 1 ms 344 KB Correct: 19 robot(s) used, 19 hour(s) passed
3 Correct 1 ms 428 KB Correct: 18 robot(s) used, 18 hour(s) passed
4 Correct 0 ms 432 KB Correct: 19 robot(s) used, 19 hour(s) passed
5 Correct 1 ms 600 KB Correct: 19 robot(s) used, 19 hour(s) passed
6 Correct 1 ms 428 KB Correct: 17 robot(s) used, 17 hour(s) passed
7 Correct 1 ms 344 KB Correct: 18 robot(s) used, 18 hour(s) passed
8 Correct 1 ms 428 KB Correct: 20 robot(s) used, 20 hour(s) passed
9 Correct 1 ms 344 KB Correct: 18 robot(s) used, 18 hour(s) passed
10 Correct 0 ms 436 KB Correct: 19 robot(s) used, 19 hour(s) passed
11 Correct 0 ms 344 KB Correct: 17 robot(s) used, 17 hour(s) passed
12 Correct 1 ms 344 KB Correct: 18 robot(s) used, 18 hour(s) passed
13 Correct 1 ms 432 KB Correct: 20 robot(s) used, 20 hour(s) passed
14 Correct 1 ms 344 KB Correct: 18 robot(s) used, 18 hour(s) passed
15 Correct 0 ms 428 KB Correct: 14 robot(s) used, 14 hour(s) passed
16 Correct 0 ms 344 KB Correct: 19 robot(s) used, 19 hour(s) passed
17 Correct 0 ms 424 KB Correct: 17 robot(s) used, 17 hour(s) passed
18 Correct 0 ms 344 KB Correct: 19 robot(s) used, 19 hour(s) passed
19 Correct 0 ms 428 KB Correct: 17 robot(s) used, 17 hour(s) passed
20 Correct 0 ms 344 KB Correct: 19 robot(s) used, 19 hour(s) passed
21 Correct 0 ms 436 KB Correct: 19 robot(s) used, 19 hour(s) passed
22 Correct 1 ms 432 KB Correct: 20 robot(s) used, 20 hour(s) passed
23 Correct 0 ms 432 KB Correct: 19 robot(s) used, 19 hour(s) passed
24 Correct 1 ms 344 KB Correct: 13 robot(s) used, 13 hour(s) passed
25 Correct 0 ms 428 KB Correct: 20 robot(s) used, 20 hour(s) passed
26 Correct 1 ms 348 KB Correct: 18 robot(s) used, 18 hour(s) passed
27 Correct 1 ms 344 KB Correct: 17 robot(s) used, 17 hour(s) passed
28 Correct 1 ms 348 KB Correct: 15 robot(s) used, 15 hour(s) passed
29 Correct 0 ms 432 KB Correct: 19 robot(s) used, 19 hour(s) passed
30 Correct 0 ms 344 KB Correct: 17 robot(s) used, 17 hour(s) passed
31 Correct 0 ms 428 KB Correct: 19 robot(s) used, 19 hour(s) passed
32 Correct 1 ms 436 KB Correct: 19 robot(s) used, 19 hour(s) passed
33 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
34 Correct 1 ms 444 KB Correct: 19 robot(s) used, 19 hour(s) passed
35 Correct 1 ms 356 KB Correct: 19 robot(s) used, 19 hour(s) passed
36 Correct 0 ms 348 KB Correct: 16 robot(s) used, 16 hour(s) passed
37 Correct 1 ms 440 KB Correct: 12 robot(s) used, 12 hour(s) passed
38 Correct 1 ms 440 KB Correct: 19 robot(s) used, 19 hour(s) passed
39 Correct 1 ms 432 KB Correct: 19 robot(s) used, 19 hour(s) passed
40 Correct 1 ms 344 KB Correct: 18 robot(s) used, 18 hour(s) passed
41 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
42 Correct 1 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
43 Correct 1 ms 432 KB Correct: 20 robot(s) used, 20 hour(s) passed
44 Correct 1 ms 428 KB Correct: 20 robot(s) used, 20 hour(s) passed
45 Correct 0 ms 344 KB Correct: 19 robot(s) used, 19 hour(s) passed
46 Correct 1 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
47 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
48 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
49 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
50 Correct 0 ms 344 KB Correct: 19 robot(s) used, 19 hour(s) passed
51 Correct 0 ms 344 KB Correct: 9 robot(s) used, 9 hour(s) passed
52 Correct 0 ms 344 KB Correct: 19 robot(s) used, 19 hour(s) passed
53 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
54 Correct 1 ms 436 KB Correct: 20 robot(s) used, 20 hour(s) passed
55 Correct 0 ms 344 KB Correct: 12 robot(s) used, 12 hour(s) passed
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -