#include "minerals.h"
#include <bits/stdc++.h>
using namespace std;
void N_less_or_equal_100(const int N) {
vector<bool> known(2*N+1, false);
int in_device = 0;
for (int i=1; i<=2*N; i++) if (!known[i]) {
// szukamy pary dla i
in_device = Query(i); // wrzucamy i do maszyny
for (int j=i+1; j<=2*N; j++) if (!known[j]) {
in_device = Query(j); // wrzucamy j do maszyny
if (in_device == 1) {
known[i] = true;
known[j] = true;
Answer(i,j);
in_device = Query(j);
break;
}
in_device = Query(j); // wyciągamy j z maszyny
}
in_device = Query(i); // wyciągamy i z maszyny
}
}
void Solve(int N) {
if (N <= 100) { N_less_or_equal_100(N); return; }
N_less_or_equal_100(N);
}
# | 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... |