Submission #703947

#TimeUsernameProblemLanguageResultExecution timeMemory
703947Chal1shkanArt Collections (BOI22_art)C++17
100 / 100
1549 ms688 KiB
# include <bits/stdc++.h> # include "art.h" # define pb push_back # define ff first # define ss second # define nl "\n" # define sz(x) ((int)(x).size()) # define deb(x) cerr << #x << " = " << x << endl; typedef long long ll; typedef unsigned long long ull; typedef long double ld; const ll maxn = 2e5 + 25; const ll inf = 2e9 + 0; const ll mod = 998244353; const ll dx[] = {-1, 1, 0, 0}; const ll dy[] = {0, 0, -1, 1}; using namespace std; int n; void solve (int N) { n = N; vector <int> v; vector <int> ans(n, 0); for (int i = 1; i <= n; ++i) v.pb(i); int cnt_prev = publish(v); for (int i = 1; i < n; ++i) { int x = v[0]; v.erase(v.begin()); v.pb(x); int cnt_cur = publish(v); ans[(cnt_prev - cnt_cur + n - 1) / 2] = i; cnt_prev = cnt_cur; } for (int i = 0; i < n; ++i) if (ans[i] == 0) ans[i] = n; 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...