# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
61718 | mAng0 | Library (JOI18_library) | C++17 | 734 ms | 704 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <cstdio>
#include <vector>
#include "library.h"
using namespace std;
vector<int> global_M;
vector<int> ban;
vector<int> ans;
int n, last;
int task_one(int s, int e){
if(s == e) return s;
int mid = (s + e) / 2;
for(int i=0;i<n;i++) global_M[i] = 0;
for(int i=s;i<=mid;i++){
global_M[i] = 1;
}
int one = Query(global_M);
for(int i=0;i<n;i++) global_M[i] = 1 - global_M[i];
int two = Query(global_M);
if(one >= two) return task_one(s, mid);
else return task_one(mid+1, e);
}
int task_two(int s, int e){
if(s == e) return s;
int mid = (s + e) / 2;
for(int i=0;i<n;i++) global_M[i] = 0;
int cnt = 0;
for(int i=s;i<=mid;i++){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |