Submission #579616

#TimeUsernameProblemLanguageResultExecution timeMemory
579616jasminArt Collections (BOI22_art)C++17
70 / 100
1662 ms624 KiB
#include<bits/stdc++.h> #include<art.h> using namespace std; /*int publish(vector<int>& p){ for(auto e: p){ cout << e << " "; } cout << "\n" << flush; int ans; cin >> ans; return ans; }*/ /*void answer(vector<int> p){ cout << "answer: "; for(auto e: p){ cout << e << " "; } cout << "\n"; }*/ void solve(int n){ vector<int> p(n); vector<pair<int,int> > ans(n); for(int i=1; i<=n; i++){ p[n-1]=i; int ind=0; for(int j=1; j<=n; j++){ if(j!=i){ p[ind]=j; ind++; } } int a=publish(p); p[0]=i; ind=1; for(int j=1; j<=n; j++){ if(j!=i){ p[ind]=j; ind++; } } int b=publish(p); ans[i-1]={a-b, i}; } sort(ans.begin(), ans.end()); reverse(ans.begin(), ans.end()); for(int i=0; i<n; i++){ p[i]=ans[i].second; } answer(p); } /*signed main(){ ios_base::sync_with_stdio(false); cin.tie(0); int n; cin >> n; solve(n); }*/

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