Submission #1206198

#TimeUsernameProblemLanguageResultExecution timeMemory
1206198dostsThe Collection Game (BOI21_swaps)C++20
21 / 100
20 ms424 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) { int iter = 5; while (iter--) { for (int i = 0;i<9;i++) { for (int j=(1<<i);j<N;j++) { if ((j+(1<<i))%(1<<(i+1)) < (1<<i)) schedule(j-(1<<i)+1,j+1); } visit(); } for (int i = 0;i<9;i++) { for (int j=(1<<i);j<N;j++) { if ((j+(1<<i))%(1<<(i+1)) >= (1<<i)) schedule(j-(1<<i)+1,j+1); } visit(); } } int iter2 = 205; while (iter2--) { for (int i = 0;i<1;i++) { for (int j=(1<<i);j<N;j++) { if ((j+(1<<i))%(1<<(i+1)) < (1<<i)) schedule(j-(1<<i)+1,j+1); } visit(); } for (int i = 0;i<1;i++) { for (int j=(1<<i);j<N;j++) { if ((j+(1<<i))%(1<<(i+1)) >= (1<<i)) schedule(j-(1<<i)+1,j+1); } 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...