Submission #750676

#TimeUsernameProblemLanguageResultExecution timeMemory
750676amirhoseinfar1385Art Collections (BOI22_art)C++17
100 / 100
1903 ms616 KiB
#include "art.h" #include<bits/stdc++.h> using namespace std; void solve(int N) { vector<int>fers(N); int n=N; vector<int>res; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ fers[(i+j)%n]=j+1; } res.push_back(publish(fers)); } vector<int>ret(n); for(int j=1;j<n;j++){ int dif=res[j]-res[j-1]; ret[(n-dif-1)/2+dif]=n-j+1; } for(int i=0;i<n;i++){ if(ret[i]==0){ ret[i]=1; break; } } answer(ret); }

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