Submission #1206201

#TimeUsernameProblemLanguageResultExecution timeMemory
1206201dostsThe Collection Game (BOI21_swaps)C++20
0 / 100
2 ms408 KiB
//
// --- Sample implementation for the task swaps ---
//
// To compile this program with the sample grader, place:
//     swaps.h swaps.cpp sample_grader.cpp
// in a single folder and run:
//     g++ swaps.cpp sample_grader.cpp
// in this folder.
//
#include "swaps.h"
#include <bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2")
//#define int long long
#define pii pair<int,int>
#define vi vector<int>
#define ff first
#define ss second
#define sp << " " <<
#define all(x) x.begin(),x.end()
#define big(x) ((int)(x.size()))
using namespace std;
const int NN = 501;
void f(int N) {
    for (int i = 8;i>=0;i--) {
        int iter2 = 12;
        while (iter2--) {
                int fl = 0;
                for (int j=(1<<i);j<N;j++) {
                    if ((j+(1<<i))%(1<<(i+1)) < (1<<i)) schedule(j-(1<<i)+1,j+1),fl =1;
                }
                if (fl) visit();
                fl = 0;
                for (int j=(1<<i);j<N;j++) {
                    if ((j+(1<<i))%(1<<(i+1)) >= (1<<i)) schedule(j-(1<<i)+1,j+1),fl = 1;
                }
                if (fl) visit();
        }
    }
}

void solve(int N, int V) {
    vi v;
    for (int i=1;i<=N;i++) v.push_back(i);
    f(N);
    answer(v);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...