Submission #1027902

#TimeUsernameProblemLanguageResultExecution timeMemory
1027902mareksbArt Collections (BOI22_art)C++17
100 / 100
923 ms1864 KiB
#include <bits/stdc++.h> #include "art.h" using namespace std; void solve(int n) { vector<int> order(n),ans,res(n); vector<pair<int,int>> tmp; iota(order.begin(),order.end(),1); for(int i=0;i<n;i++){ res[i]=publish(order); rotate(order.begin(),order.begin()+1,order.end()); } for(int i=0;i<n;i++){ int diff=res[(i+1)%n]-res[i]; tmp.push_back({diff,i+1}); } sort(tmp.begin(),tmp.end(),greater<pair<int,int>>()); for(auto& p:tmp){ ans.push_back(p.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...