# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
873408 | Faisal_Saqib | The Collection Game (BOI21_swaps) | C++17 | 18 ms | 688 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.
//
// --- Sample implementation for the task swaps ---
//
// To compile this program with the sample grader, place:
// swaps.h swaps_sample.cpp sample_grader.cpp
// in a single folder and run:
// g++ swaps_sample.cpp sample_grader.cpp
// in this folder.
//
#include "swaps.h"
#include <iostream>
#include <vector>
using namespace std;
bool pos=1;
vector<int> DNC(int l,int r)
{
if(l==r)
return {l};
int mid=(l+r)/2;
vector<int> final,fh=DNC(l,mid),sh=DNC(mid+1,r);
int i=0,j=0;
while(i<fh.size() and j<sh.size())
{
schedule(fh[i],sh[j]);
int p=visit()[0];
if(p)
final.push_back(fh[i++]);
else
{
pos=0;
final.push_back(sh[j++]);
}
}
while(i<fh.size())
final.push_back(fh[i++]);
while(j<sh.size())
final.push_back(sh[j++]);
return final;
}
void solve(int n, int v) {
pos=1;
auto pa=DNC(1,n);
if(pos)
exit(-100);
answer(pa);
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |