# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
836165 | _martynas | Minerals (JOI19_minerals) | C++14 | 468 ms | 28016 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 "minerals.h"
#include <bits/stdc++.h>
using namespace std;
set<int> in;
map<int, int> M;
/*
solve(A, B)
A -> C D
B -> E F
solve(C, E), solve(F, D)
*/
int resp;
int ops[3], cnt[3];
void solve(set<int> A, set<int> B) {
assert(A.size() == B.size());
if(A.empty()) return;
// found a pair
if(A.size() == 1) {
M[*A.begin()] = *B.begin();
return;
}
// check which scenario solve is in
// 1. all A are in, no B are in
// 2. all A are in, all B are in
// 3. no A are in, no B are in
int ina = 0;
for(int a : A) {
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |