Submission #1044091

#TimeUsernameProblemLanguageResultExecution timeMemory
1044091vjudge1Zagonetka (COI18_zagonetka)C++17
0 / 100
1 ms344 KiB
#include<bits/stdc++.h> using namespace std; void print(vector<int> v) { for(int i = 0; i + 1 < v.size(); i++) cout << v[i]; cout << v.back() << endl; } bool ask(vector<int> v) { cout << "query "; print(v); bool res; cin >> res; return res; } void out(vector<int> a, vector<int> b) { cout << "end\n"; print(a); print(b); exit(0); } int main() { int n; cin >> n; vector<int> p(n), a, b; for(int i = 0; i < n; i ++) cin >> p[i]; a = b = p; sort(p.begin(), p.end()); do { bool res = ask(p); if(res) a = min(a, p), b = max(a, p); } while(next_permutation(p.begin(), p.end())); out(a, b); return 0; }

Compilation message (stderr)

zagonetka.cpp: In function 'void print(std::vector<int>)':
zagonetka.cpp:7:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |   for(int i = 0; i + 1 < v.size(); i++)
      |                  ~~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...