Submission #951756

#TimeUsernameProblemLanguageResultExecution timeMemory
951756zordenoArt Collections (BOI22_art)C++17
100 / 100
1153 ms1784 KiB
#include<bits/stdc++.h> #include "art.h" //#include "sample_grader.cpp" using namespace std; #define endl '\n' #define ll long long vector <int> dx = {1, 0, 0, -1, 0, 0}; vector <int> dy = {0, 1, 0, 0, -1, 0}; vector <int> dz = {0, 0, 1, 0, 0, -1}; ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } const ll MAX = 2005, MOD = 1e9 + 7, INF = 1e18; void solve(int n) { vector <int> vec(n); for (int i = 0; i < n; i++) { vec[i] = i + 1; } vector <pair<int, int>> v(n); v[0].first = publish(vec); v[n - 1].second = v[0].first; if (v[0].first == 0) { answer(vec); } for (int i = 1; i < n; i++) { rotate(vec.begin(), vec.begin() + 1, vec.end()); v[i - 1].second = publish(vec); v[i].first = v[i - 1].second; } for (int i = 0; i < n; i++) { v[i].first = (v[i].first - v[i].second + n - 1) / 2; v[i].second = i + 1; } sort(v.begin(), v.end()); for (int i = 0; i < n; i++) { vec[i] = v[i].second; } 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...