Submission #732021

#TimeUsernameProblemLanguageResultExecution timeMemory
732021TB_Art Collections (BOI22_art)C++17
100 / 100
1576 ms692 KiB
#include <bits/stdc++.h> #include "art.h" using namespace std; // #pragma GCC optimize("Ofast,inline") // #pragma GCC optimize("unroll-loops") #define ll long long #define INF (ll)1e9+7 #define fo(i,n) for(ll i = 0;i<n;i++) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define deb(x) cout << #x << " = " << x << endl; #define pb push_back #define F first #define S second #define LSOne(x) ((x) & (-x)) typedef vector<int> vi; typedef vector<ll> vl; // int publish(vi v){ // fo(i, v.size())cout << v[i] << " "; // cout << endl; // int r; // cin >> r; // return r; // } void solve(int n){ vi v(n); fo(i, n){ v[i] = i+1; } vi res; fo(i, n){ res.pb(publish(v)); // deb((publish(v)-); reverse(all(v)); int val = v[n-1]; v.pop_back(); reverse(all(v)); v.pb(val); } vector<pair<ll, ll>> ans; int last = res[n-1]; fo(i, n){ // deb((last-res[i])); ans.pb({last-res[i], (i?i:n)}); last = res[i]; } sort(all(ans)); vi toSend; fo(i, n){ toSend.pb(ans[i].S); // deb(ans[i].F); // deb(ans[i].S); } // deb(ans[0].S); // toSend.pb(ans[0].S); answer(toSend); }

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...