Submission #746465

#TimeUsernameProblemLanguageResultExecution timeMemory
746465SzilArt Collections (BOI22_art)C++17
100 / 100
1705 ms676 KiB
#include "art.h" #include <bits/stdc++.h> using namespace std; int ask(int first, int n) { vector<int> q; for (int i = first; i <= n; i++) { q.push_back(i); } for (int i = 1; i < first; i++) { q.push_back(i); } return publish(q); } void solve(int n) { int x = ask(1, n); cerr << x << endl; vector<int> ans(n); for (int i = 2; i <= n; i++) { int y = ask(i, n); int delta = x-y; int rank = (delta + 1 + n) / 2; ans[rank-1] = i-1; x = y; } for (int &i : ans) { if (i == 0) { i = n; break; } } 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...