Submission #672062

#TimeUsernameProblemLanguageResultExecution timeMemory
672062LittleCubeArt Collections (BOI22_art)C++17
100 / 100
1536 ms676 KiB
#include "art.h" #include <bits/stdc++.h> #define ll long long #define pii pair<int, int> #define pll pair<ll, ll> #define F first #define S second using namespace std; int vis[4005], arr[4005]; void solve(int N) { vector<int> ans(N); for (int i = 1; i <= N; i++) { vector<int> v; for (int j = i; j <= N; j++) v.emplace_back(j); for (int j = 1; j < i; j++) v.emplace_back(j); arr[i] = publish(v); } arr[N + 1] = arr[1]; for (int i = 1; i <= N; i++) { // A + B = N - 1, B - A = arr[i + 1] - arr[i]; int A = N - 1 + arr[i] - arr[i + 1]; A /= 2; ans[A] = i; } answer(ans); }

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