Submission #714258

#TimeUsernameProblemLanguageResultExecution timeMemory
714258vjudge1Art Collections (BOI22_art)C++17
20 / 100
112 ms208 KiB
#include <bits/stdc++.h> #include "art.h" #define ll long long #define pii pair<int, int> using namespace std; void solve(int N){ int n = N; vector<int> pos(n + 1, 0); for (int i = 1; i <= n; i++) { for (int j = i + 1; j <= n; j++) { vector<int> v = {i, j}; for (int k = 1; k <= n; k++) { if(k == i || k == j) continue; v.emplace_back(k); } int p1 = publish(v); swap(v[0], v[1]); int p2 = publish(v); if(p2 < p1){ pos[i]++; } else{ pos[j]++; } } } vector<int> ans(n); for (int i = 1; i <= n; i++) { ans[pos[i]] = i; } 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...