Submission #572897

#TimeUsernameProblemLanguageResultExecution timeMemory
572897AmirElarbiArt Collections (BOI22_art)C++17
70 / 100
1634 ms688 KiB
#include <bits/stdc++.h> #define vi vector<int> #define ve vector #define ll long long #define vf vector<float> #define vll vector<pair<ll,ll>> #define ii pair<int,int> #define vvi vector<vi> #define vii vector<ii> #define gii greater<ii> #define pb push_back #define mp make_pair #define fi first #define se second #define INF 1e9 #define eps 1e-7 #define eps1 1e-2 #define optimise ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define MAX_A 2e5+5 using namespace std; const int MOD = 1e4+7; const int nax = 5e3+7; #include "art.h" typedef complex<int> Point; #define X real() #define Y imag() void solve(int N) { int n = N; int ans[N]; for (int i = 1; i <= n; ++i) { vi order; order.pb(i); for (int j = 1; j <= n; ++j) { if(i!=j) order.pb(j); } int ans1 = publish(order); order.clear(); for (int j = 1; j <= n; ++j) { if(i!=j) order.pb(j); } order.pb(i); int ans2 = publish(order); int diff = ans1-ans2+n-1; ans[diff/2] = i; } vi res; for (int i = 0; i < n; ++i) { res.pb(ans[i]); } //for(auto x : ans) //cout << x << endl; answer(res); }

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