Submission #1093458

#TimeUsernameProblemLanguageResultExecution timeMemory
1093458andrewpArt Collections (BOI22_art)C++17
100 / 100
1107 ms1844 KiB
//Dedicated to my love, ivaziva #pragma GCC optimize("Ofast") #include "art.h" #include <bits/stdc++.h> using namespace std; using pii = pair<int, int>; using ll = int64_t; #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define dbg(x) cerr << #x << ": " << x << '\n'; const int N = 4010; void solve(int n) { vector<int> a; for (int i = 1; i <= n; i++) { vector<int> perm; for (int j = i; j <= n; j++) { perm.push_back(j); } for (int j = 1; j <= i - 1; j++) { perm.push_back(j); } a.push_back(publish(perm)); } vector<pii> srt; for (int i = 1; i < n; i++) { srt.push_back({a[i - 1] - a[i], i}); } srt.push_back({a[n - 1] - a[0], n}); sort(all(srt)); vector<int> ans; for (auto x : srt) { ans.push_back(x.second); } answer(ans); } // int32_t main() { // ios::sync_with_stdio(false); cin.tie(nullptr); // cout.tie(nullptr); cerr.tie(nullptr); // return 0; // }

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