Submission #963563

#TimeUsernameProblemLanguageResultExecution timeMemory
963563aegArt Collections (BOI22_art)C++17
50 / 100
564 ms1304 KiB
#include "art.h" #include <bits/stdc++.h> using namespace std; void solve(int N) { vector<int> def(N); iota(def.begin(), def.end(), 1); int defval = publish(def); vector<int> ans = def; stable_sort(ans.begin(), ans.end(), [&](int a, int b){ def[a-1] = b; def[b-1] = a; int curval = publish(def); def[a-1] = a; def[b-1] = b; if(defval < curval) { if(a > b) { return false; } else { return true; } } else { if(a > b) { return true; } else { return false; } } }); 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...