Submission #796713

#TimeUsernameProblemLanguageResultExecution timeMemory
796713TheSahibArt Collections (BOI22_art)C++17
50 / 100
652 ms392 KiB
#include "art.h" #include <bits/stdc++.h> using namespace std; vector<int> v; int x = 0; bool comp(int a, int b){ swap(v[a - 1], v[b - 1]); int y = publish(v); swap(v[a - 1], v[b - 1]); if(a < b){ return x < y; } else{ return x > y; } } void solve(int N) { v.resize(N); iota(v.begin(), v.end(), 1); x = publish(v); vector<int> ans(N); iota(ans.begin(), ans.end(), 1); stable_sort(ans.begin(), ans.end(), comp); answer(ans); }

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