Submission #660123

#TimeUsernameProblemLanguageResultExecution timeMemory
660123KarukArt Collections (BOI22_art)C++17
100 / 100
1594 ms684 KiB
#include<bits/stdc++.h> #include "art.h" using namespace std; void solve(int n) { long long num=0; vector<int>d; for(int i=1;i<=n;i++)d.push_back(i); vector<int>ans(n); vector<int>v; for(int i=0;i<n;i++) { v.push_back(publish(d)); d.push_back(d[0]); d.erase(d.begin(),d.begin()+1); } v.push_back(v[0]); for(int i=1;i<=n;i++) { int val=v[i]-v[i-1]; val-=n; val*=-1; val--; val/=2; ans[val]=i; } answer(ans); }

Compilation message (stderr)

art.cpp: In function 'void solve(int)':
art.cpp:5:15: warning: unused variable 'num' [-Wunused-variable]
    5 |     long long num=0;
      |               ^~~
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...