Submission #1188866

#TimeUsernameProblemLanguageResultExecution timeMemory
1188866lizaArt Collections (BOI22_art)C++20
0 / 100
11 ms408 KiB
#include "art.h"
#include <bits/stdc++.h>

using namespace std;

void solve(int N) {
    vector<int> order;
    for (int i = 1; i <= N; i++)
    {
        order.push_back(i);
    }
    bool c=0;
    int r = publish(order), newr;
    if(r==0)
    {
        answer(order);
    }
    while(1){
    for(int i= 0; i < N-1; i++)
    {
        c=0;
        for(int j = 0; j < N-i-1; j++)
        {
            swap(order[j], order[j + 1]);
            newr = publish(order);
            if(newr==0)
            {
                answer(order);
            }
            if(newr>=r)
            {
                swap(order[j], order[j + 1]);
            }
            else
            {
                c=1;
            }
           /* for (auto k:order)
            {
                cout << k << " ";
            }
            cout << "\n";*/
        }
    }
    }

}


//publish
//answer
#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...