Submission #714446

#TimeUsernameProblemLanguageResultExecution timeMemory
714446vjudge1Art Collections (BOI22_art)C++17
35 / 100
180 ms208 KiB
#include "art.h" #include "bits/stdc++.h" #define intt long long #define pb push_back #define endl '\n' #define F first #define S second #define pii pair<int,int> #define pll pair<intt,intt> #define ld long double #define fast_io ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); using namespace std; const int sz = 2e5+5; int inv; int n; bool cmp(int i, int j) { vector<int>v; for ( int k = 1; k <= n; k++ ) if(k != i and k != j) v.pb(k); v.pb(i);v.pb(j); int inv1 = publish(v); v.pop_back();v.pop_back(); v.pb(j);v.pb(i); int inv2 = publish(v); return inv1 < inv2; } void solve(int N) { n = N; vector<int>res; for ( int i = 1; i <= n; i++ ) res.pb(i); stable_sort(res.begin(),res.end(), cmp); answer(res); }

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