Submission #1007454

#TimeUsernameProblemLanguageResultExecution timeMemory
1007454makanhuliaArt Collections (BOI22_art)C++17
0 / 100
0 ms344 KiB
#include <bits/stdc++.h> #include "art.h" using namespace std; #define pb push_back #define pi pair<int, int> #define endl '\n' #define all(v) v.begin(), v.end() #define fr(m,n,k) for(int m=n;m<=k;m++) #define vi vector<int> int n; void solve(int N) { cin >> n; vector<int> v; fr(i, 1, n) v.pb(i); vector<pi> is; int has[n + 1] = {}; fr(i, 1, n) { has[i] = publish(v); int x = *v.begin(); v.pb(x); v.erase(v.begin()); } has[0] = has[n]; fr(i, 1, n) { is.pb({has[i] - has[i - 1], i - 1}); } sort(is.rend(), is.rbegin()); vi an(n); fr(i, 0, n - 1) { auto [_, pos] = is[i]; an[i] = pos; } answer(an); }

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