Submission #643413

#TimeUsernameProblemLanguageResultExecution timeMemory
643413makanhuliaZagonetka (COI18_zagonetka)C++17
9 / 100
8 ms208 KiB
#include <bits/stdc++.h> using namespace std; bool ask(vector<int>&v){ cout << "query "; for(auto &x: v) cout << x << " "; cout << endl; bool ret; cin >> ret; return ret; } void st1(int n){ vector<int>v(n); for(int i = 0; i < n; i++) cin >> v[i]; sort(v.begin(), v.end()); vector<int>mini(n, 1e9), maxi(n, -1); do{ if(ask(v)){ if(v < mini) mini = v; if(v > maxi) maxi = v; } } while (next_permutation(v.begin(), v.end())); cout << "end" << endl; for(auto &x: mini) cout << x << " "; cout << endl; for(auto &x: maxi) cout << x << " "; cout << endl; } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; if(n <= 6) st1(n); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...