Submission #750339

#TimeUsernameProblemLanguageResultExecution timeMemory
750339parsadox2Art Collections (BOI22_art)C++17
100 / 100
1604 ms808 KiB
#include <bits/stdc++.h> #define pb push_back #define F first #define S second #define debug(x) cout << #x << "= " << x << ", " #define ll long long #define fast ios::sync_with_stdio(false), cin.tie(0), cout.tie(0) #define SZ(x) (int) x.size() #define wall cout << endl; using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); #include "art.h" const int maxn = 4e3 + 10; int ans[maxn] , b[maxn]; void solve(int n) { for(int i = 1 ; i <= n ; i++) { vector <int> vec; for(int j = i ; j <= n ; j++) vec.pb(j); for(int j = 1 ; j < i ; j++) vec.pb(j); ans[i] = publish(vec); } vector <int> vec(n); for(int i = 1 ; i <= n ; i++) { int nex = (i == n ? 1 : i + 1); int tmp = ans[i] + ans[nex] - (n - 1); tmp /= 2; b[i] = ans[i] - tmp; vec[b[i]] = i; } answer(vec); }

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