QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#72190#4565. Rarest InsectsAurora0 67ms3760kbC++17701b2023-01-14 23:23:082023-01-14 23:23:08

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-01-14 23:23:08]
  • 评测
  • 测评结果:0
  • 用时:67ms
  • 内存:3760kb
  • [2023-01-14 23:23:08]
  • 提交

answer

#include "insects.h"
#include <bits/stdc++.h>
const int N = 1e5;
using namespace std;
mt19937 rand1(time(0));


int cnt, opt[N + 5];
int query() {return press_button();}

int min_cardinality(int n) {
	for(int i = 1; i <= n; ++i) {
		move_inside(i - 1);
		if (query() > 2) move_outside(i - 1);
		else ++cnt;
	}
	int l = 1, r = n, mid, ans;
	while(l <= r) {
		int now = 0; mid = l + r >> 1;
		for(int i = 1; i <= n; ++i) opt[i] = i;
		shuffle(opt + 1, opt + n + 1, rand1);
		for(int i = 1; i <= n; ++i) {
			move_inside(i - 1); ++now;
			if (query() > mid) move_outside(i - 1), --now;
		}
		if (now < cnt * mid) r = mid - 1;
		else l = mid + 1, ans = mid;;
	}
	return ans;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 3ms
memory: 3740kb

input:

6
1
1
1
2
2
3
2
2
2
2
2
3
3
3
3
2
2
1

output:

8
0 0
8
2
8
0 1
8
2
8
0 2
8
2
8
0 3
8
2
8
0 4
8
2
8
0 5
8
2
8
1 5
8
0 0
8
2
8
0 1
8
2
8
0 2
8
2
8
0 3
8
2
8
0 4
8
2
8
0 5
8
2
8
0 0
8
2
8
1 0
8
0 1
8
2
8
1 1
8
0 2
8
2
8
1 2
8
0 3
8
2
8
1 3
8
0 4
8
2
8
1 4
8
0 5
8
2
8
3 0

result:

wrong answer Wrong answer.

Subtask #2:

score: 0
Wrong Answer

Test #24:

score: 0
Wrong Answer
time: 67ms
memory: 3760kb

input:

1000
1
2
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3...

output:

8
0 0
8
2
8
0 1
8
2
8
0 2
8
2
8
1 2
8
0 3
8
2
8
1 3
8
0 4
8
2
8
1 4
8
0 5
8
2
8
1 5
8
0 6
8
2
8
1 6
8
0 7
8
2
8
1 7
8
0 8
8
2
8
1 8
8
0 9
8
2
8
1 9
8
0 10
8
2
8
1 10
8
0 11
8
2
8
1 11
8
0 12
8
2
8
1 12
8
0 13
8
2
8
1 13
8
0 14
8
2
8
1 14
8
0 15
8
2
8
1 15
8
0 16
8
2
8
1 16
8
0 17
8
2
8
1 17
8
0 18
8...

result:

wrong answer Wrong answer.

Subtask #3:

score: 0
Wrong Answer

Test #43:

score: 0
Wrong Answer
time: 2ms
memory: 3640kb

input:

2
1
2
2
1

output:

8
0 0
8
2
8
0 1
8
2
8
0 0
8
2
8
1 0
8
0 1
8
2
8
3 0

result:

wrong answer Wrong answer.