Submission #950849

#TimeUsernameProblemLanguageResultExecution timeMemory
950849Mr_PhArt Collections (BOI22_art)C++17
100 / 100
1191 ms1824 KiB
#include "art.h" //#include "sample_grader.cpp" #include<bits/stdc++.h> using namespace std; void solve(int n) { vector<int>arr; for(int i=1;i<=n;i++) arr.push_back(i); int x=publish(arr); vector<int>xd; xd.push_back(x); for(int i=0;i<n-1;i++) { int prv=arr[n-1]; for(int j=n-2;j>=0;j--) { int o=arr[j]; arr[j]=prv; prv=o; } arr[n-1]=prv; x=publish(arr); xd.push_back(x); } vector<int>ans(n); for(int i=0;i<n;i++) { int a=xd[i],b=xd[(i+1)%n]; int lol=b-a; int idx=-(lol-(n-1))/2; // cout<<idx<<endl; ans[idx]=i+1; } 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...