Submission #796751

#TimeUsernameProblemLanguageResultExecution timeMemory
796751TheSahibArt Collections (BOI22_art)C++17
100 / 100
1341 ms636 KiB
#include "art.h" #include <bits/stdc++.h> using namespace std; vector<int> v; int x = 0; int arr[4005]; bool comp(int a, int b){ return arr[a] > arr[b]; } void solve(int N) { v.resize(N); iota(v.begin(), v.end(), 1); vector<int> abc; for (int i = 0; i < N; i++) { abc.push_back(publish(v)); v.insert(v.begin(), v.back()); v.pop_back(); } for (int i = 0; i < N; i++) { int j = (1 + i) % N; arr[N - i] = abc[(j - 1 + N) % N] - abc[j]; } vector<int> ans(N); iota(ans.begin(), ans.end(), 1); stable_sort(ans.begin(), ans.end(), comp); 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...