Submission #1186219

#TimeUsernameProblemLanguageResultExecution timeMemory
1186219qwushaArt Collections (BOI22_art)C++20
70 / 100
743 ms516 KiB
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
typedef long long ll;
typedef long double ld;
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
int inf = 1e15;

#include "art.h"

void solve(int n) {
    vector<int> a1(n), a2(n);
    vector<pair<int, int>> s;
    for (int i = 0; i < n; i++) {
        a1[0] = i + 1;
        int cur = 1;
        for (int j = 0; j < n; j++) {
            if (j == i)
                continue;
            a1[cur] = j + 1;
            cur++;
        }
        a2[n - 1] = i + 1;
        cur = 0;
        for (int j = 0; j < n; j++) {
            if (j == i)
                continue;
            a2[cur] = j + 1;
            cur++;
        }
        int k = publish(a1);
        int m = publish(a2);
        int val = (k - m + n - 1) / 2;
        s.push_back({val, i});
    }
    sort(s.begin(), s.end());
    vector<int> res;
    for (int i = 0; i < n; i++) {
        res.push_back(s[i].se + 1);
    }
    answer(res);
}

Compilation message (stderr)

art.cpp:8:11: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+15' to '2147483647' [-Woverflow]
    8 | int inf = 1e15;
      |           ^~~~
#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...