QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#72185 | #4565. Rarest Insects | Aurora | Compile Error | / | / | C++14 | 696b | 2023-01-14 21:50:18 | 2023-01-14 21:50:20 |
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 21:50:20]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-01-14 21:50:18]
- 提交
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() > k) move_outside(i - 1), --now;
}
if (now < cnt * k) r = mid - 1;
else l = mid + 1, ans = mid;;
}
return ans;
}
Details
implementer.cpp:8:8: warning: inline variables are only available with ‘-std=c++17’ or ‘-std=gnu++17’ 8 | static inline constexpr int kMaxQueries = 40000; | ^~~~~~ answer.code:8:1: error: expected ‘,’ or ‘;’ before ‘int’ 8 | int cnt, opt[N + 5]; | ^~~ answer.code: In function ‘int min_cardinality(int)’: answer.code:15:24: error: ‘cnt’ was not declared in this scope; did you mean ‘int’? 15 | else ++cnt; | ^~~ | int answer.code:20:45: error: ‘opt’ was not declared in this scope 20 | for(int i = 1; i <= n; ++i) opt[i] = i; | ^~~ answer.code:21:25: error: ‘opt’ was not declared in this scope 21 | shuffle(opt + 1, opt + n + 1, rand1); | ^~~ answer.code:24:39: error: ‘k’ was not declared in this scope 24 | if (query() > k) move_outside(i - 1), --now; | ^ answer.code:26:27: error: ‘cnt’ was not declared in this scope; did you mean ‘int’? 26 | if (now < cnt * k) r = mid - 1; | ^~~ | int answer.code:26:33: error: ‘k’ was not declared in this scope 26 | if (now < cnt * k) r = mid - 1; | ^