Submission #825033

#TimeUsernameProblemLanguageResultExecution timeMemory
825033vjudge1Art Collections (BOI22_art)C++17
70 / 100
1269 ms612 KiB
#include <bits/stdc++.h> #include "art.h" #define el '\n' #define fi first #define sc second //#define int ll #define pii pair<int, int> #define all(v) v.begin(), v.end() using namespace std; using ll=long long; using ull=unsigned long long; using ld=long double; const int mod=1e9+7; const int N=1e5+11; int ask(int x, int n) { vector<int> a; a.push_back(x); for(int i=1;i<=n;i++) if(x!=i) a.push_back(i); return publish(a); } void read(vector<int>& v, int x, int p) { vector<int> b; for(int i=0;i<p;i++) b.push_back(v[i]); b.push_back(x); for(int i=p; i<v.size(); i++) b.push_back(v[i]); vector<int> cc=b; b=v; v=cc; } void solve(int n) { vector<int> ans; ans.push_back(1); for(int i = 2; i <= n; i++) read(ans, i, (i-1-ask(1, n)+ask(i,n))/2); answer(ans); } //signed main() //{ //// freopen("divisor.INP", "r", stdin); //// freopen("divisor.OUT", "w", stdout); // ios_base::sync_with_stdio(0); // cin.tie(0); // int t=1; // //cin >> t; // while(t--) // { // sol(); // } //}

Compilation message (stderr)

art.cpp: In function 'void read(std::vector<int>&, int, int)':
art.cpp:27:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |  for(int i=p; i<v.size(); i++) b.push_back(v[i]);
      |               ~^~~~~~~~~
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...