# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
606247 | alireza_kaviani | Library (JOI18_library) | C++17 | 44 ms | 352 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 "library.h"
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define SZ(x) int((x).size())
void Solve(int n){
vector<int> M(n , 1);
vector<int> res;
for(int i = 0 ; i < n ; i++){
M[i] = 0;
if(Query(M) <= 1){
res.push_back(i);
break;
}
M[i] = 1;
}
fill(all(M) , 0);
M[res[0]] = 1;
for(int i = 0 ; i < n ; i++){
if(M[i]) continue;
M[i] = 1;
if(Query(M) <= 1){
res.push_back(i);
continue;
}
M[i] = 0;
}
for(int i = SZ(res) ; i < n ; i++){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |