Submission #1111674

#TimeUsernameProblemLanguageResultExecution timeMemory
1111674n3rm1nArt Collections (BOI22_art)C++17
100 / 100
1391 ms1884 KiB
#include<bits/stdc++.h> #include "art.h" using namespace std; const int MAXN = 4005; int n, ans[MAXN]; void fillans(int x) { vector < int > g; for (int i = x; i <= n; ++ i) g.push_back(i); for (int i = 1; i < x; ++ i) g.push_back(i); ans[x] = publish(g); } int p[MAXN]; void doanswer() { vector < int > g; for (int i = 1; i <= n; ++ i) g.push_back(p[i]); answer(g); } void solve(int N) { n = N; for (int i = 1; i <= n; ++ i) fillans(i); ans[n+1] = ans[1]; for (int i = 1; i <= n; ++ i) { int smallerminusbigger = ans[i+1] - ans[i]; p[(n - 1 - (smallerminusbigger))/2 + 1] = i; } doanswer(); }

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