QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#137781 | #3097. Shopping | Mohammed_Atalah | 0 | 1ms | 3868kb | C++20 | 1.3kb | 2023-08-10 17:32:49 | 2023-08-10 17:32:56 |
Judging History
Anna
#include "Anna.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
namespace {
int N, L, R;
int cnt;
vector<int> status;
int res;
} // namespace
void InitA(int N, int L, int R) {
::N = N;
::L = L;
::R = R;
res = L;
cnt = 0;
int l = L;
for (int i = 0; i <= 14; i ++) {
if ((l >> i) && 1) {
SendA(1);
} else {
SendA(0);
}
}
}
void getans() {
for (int i = L; i <= R; i ++) {
if (status[i]) {
res = i;
}
}
}
void ReceiveA(bool x) {
// cout << x << ' ';
status.push_back(x);
cnt++;
if (cnt == N) {
getans();
}
}
int Answer() {
return res;
}
Bruno
#include "Bruno.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
namespace {
int N;
vector<int> nums;
int cnt = 0;
int L = 0;
}
void minel() {
for (int i = 0; i < L; i ++) {
SendB(0);
}
int mn = nums[L];
SendB(1);
for (int i = L + 1; i < N; i ++) {
if (nums[i] < mn) {
mn = nums[i];
SendB(1);
} else {
SendB(0);
}
}
}
void InitB(int N, std::vector<int> P) {
::N = N;
nums = P;
}
void ReceiveB(bool y) {
if (y)
L += pow(2, cnt);
cnt++;
if (cnt == 16) {
minel();
}
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 1
Accepted
time: 0ms
memory: 3636kb
input:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 -1
output:
-1 -1 -1
input:
output:
Accepted: 15 0
result:
ok
Test #2:
score: 1
Accepted
time: 1ms
memory: 3868kb
input:
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 -1
output:
-1 -1 -1
input:
output:
Accepted: 15 0
result:
ok
Test #3:
score: 0
Wrong Answer
time: 1ms
memory: 3720kb
input:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 -1
output:
-1 -1 -1
input:
output:
Wrong Answer [2]
result:
wrong answer
Subtask #2:
score: 0
Skipped
Subtask #3:
score: 0
Skipped