Submission #968893

#TimeUsernameProblemLanguageResultExecution timeMemory
968893PwoArt Collections (BOI22_art)C++17
100 / 100
1223 ms1692 KiB
#include <bits/stdc++.h> #include "art.h" using namespace std; typedef long long ll; void solve(int N) { pair<int, int> a[N]; vector<int> v(N, 0); for (int i = 0; i < N; i++) v[i] = i + 1; for (int i = 0; i < N; i++) { int u = publish(v); a[i] = {u, i + 1}; rotate(v.begin(), v.begin() + 1, v.end()); } int tmp = a[0].first; for (int i = 0; i < N - 1; i++) a[i].first = a[i + 1].first - a[i].first; a[N - 1].first = tmp - a[N - 1].first; sort(a, a + N); vector<int> ans; for (int i = N - 1; i >= 0; i--) ans.push_back(a[i].second); 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...