Submission #721574

#TimeUsernameProblemLanguageResultExecution timeMemory
721574Mr_HusanboyArt Collections (BOI22_art)C++17
5 / 100
9 ms256 KiB
#include "art.h" #include<bits/stdc++.h> #define all(a) (a).begin(), (a).end() template<typename T> int len(T &a){ return a.size(); } using namespace std; void solve(int n) { vector<int> v(n); iota(all(v), 1); int inv = publish(v); vector<vector<bool>> comp(n, vector<bool> (n)); for(int i = 1; i <= n; i ++){ for(int j = i + 1; j <= n; j ++){ swap(v[i - 1], v[j - 1]); int x = publish(v); if(x < inv){ comp[i - 1][j - 1] = 0; comp[j - 1][i - 1] = 1; } swap(v[i - 1], v[j - 1]); } } sort(all(v), [&](int a, int b){ return comp[a - 1][b - 1]; }); answer(v); }

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