Submission #643559

#TimeUsernameProblemLanguageResultExecution timeMemory
643559makanhuliaZagonetka (COI18_zagonetka)C++17
9 / 100
8 ms208 KiB
#include <bits/stdc++.h> using namespace std; const int N = 105; int n, a[N]; int main() { cin.tie(0); ios_base::sync_with_stdio(0); cin >> n; for(int i = 1; i <= n; i++) cin >> a[i]; if(n <= 6) { vector<int> p, mx, mn; for(int i = 1; i <= n; i++) p.push_back(i); do { cout << "query "; for(int i = 0; i < n; i++) { cout << p[i] << " "; } cout << endl; int x; cin >> x; if(x) { if(mx.empty()) { mx = p; } else { if(p > mx) mx = p; } if(mn.empty()) mn = p; else if(p < mn) mn = p; } } while(next_permutation(p.begin(), p.end())); cout << "end\n"; for(auto i : mn) cout << i << " "; for(auto i : mx) cout << i << " "; cout << endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...