Submission #673874

#TimeUsernameProblemLanguageResultExecution timeMemory
673874gesghaArt Collections (BOI22_art)C++17
70 / 100
1532 ms672 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; vector<int> order; int n; int ans[N]; void solve(int k) { n = k; order.resize(n, 0); iota(all(order), 1); int was = publish(order); for (int i = 0; i < n; ++i) { int x = was; order.erase(order.begin()); order.pb(i + 1); int y = publish(order); int vl = (x + y - (n - 1)) / 2; ans[x - vl] = i; was = y; } order.clear(); fr(i, 0, n - 1) order.pb(ans[i] + 1); 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...