Submission #673853

#TimeUsernameProblemLanguageResultExecution timeMemory
673853gesghaArt Collections (BOI22_art)C++17
20 / 100
117 ms296 KiB
#include <bits/stdc++.h>
#include "art.h"

#define fr(i, a, b) for (int i = a; i <= b; ++i)
#define rf(i, a, b) for (int i = a; i >= b; --i)
#define fe(x, y) for (auto& x : y)

#define fi first
#define se second
#define pb push_back

#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define pw(x) (1LL << (x))

using namespace std;

template <typename T>
using ve = vector < T >;

template <typename T>
bool umx(T& a, T b) {return a < b ? a = b, 1 : 0;}

template <typename T>
bool umn(T& a, T b) {return a > b ? a = b, 1 : 0;}

using ll = long long;
using pll = pair <ll, ll>;
using pii = pair <int, int>;

const int N = 2e5 + 100;
const int oo = 1e9 + 10;
const ll OO = 1e18 + 100;

void solve(int n) {
    vector<int> order(n);
    iota(all(order), 1);
    int val = publish(order);
    for (int i = 0; i < n; i++) {

        for (int j = i + 1; j < n; j++) {
            swap(order[i], order[j]);
            int x = publish(order);
            if (val > x) {
                val = x;
            } else swap(order[i], order[j]);
        }
    }
    answer(order);
}

Compilation message (stderr)

interface.cpp: In function 'int publish(std::vector<int>)':
interface.cpp:20:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~
interface.cpp: In function 'void answer(std::vector<int>)':
interface.cpp:36:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   36 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~
#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...