Submission #924224

#TimeUsernameProblemLanguageResultExecution timeMemory
924224asdasdqwerArt Collections (BOI22_art)C++17
100 / 100
1336 ms64312 KiB
#include <bits/stdc++.h> #include "art.h" using namespace std; map<vector<int>, int> quer; int query(vector<int> &a) { if (quer.find(a) != quer.end()) { return quer[a]; } int sol = publish(a); quer[a] = sol; return sol; } void solve(int n) { vector<int> a(n); for (int i=0;i<n;i++) { a[i]=i+1; } vector<int> res(n); for (int i=0;i<n;i++) { int r1 = query(a); int f=a[0]; a.erase(a.begin()); a.push_back(f); int r2 = query(a); res[(r1-r2+n)/2]=i+1; } answer(res); }

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