Submission #240755

# Submission time Handle Problem Language Result Execution time Memory
240755 2020-06-21T06:45:45 Z VEGAnn Zagonetka (COI18_zagonetka) C++14
9 / 100
13 ms 512 KB
#include <bits/stdc++.h>
#define PB push_back
#define all(x) x.begin(),x.end()
#define sz(x) ((int)x.size())
using namespace std;
const int N = 100100;
vector<vector<int> > ans;
vector<int> vc;
int n, p[N];

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);

#ifdef _LOCAL
//    freopen("in.txt","r",stdin);
#endif // _LOCAL

    cin >> n;

    assert(n <= 6);

    for (int i = 1; i <= n; i++)
        cin >> p[i];

    for (int i = 1; i <= n; i++)
        vc.PB(i);

    do{
        cout << "query";

        for (int cr : vc)
            cout << " " << cr;
        cout << endl;

        int res; cin >> res;

        if (res == 1)
            ans.PB(vc);
    } while (next_permutation(all(vc)));

    sort(all(ans));

    cout << "end" << endl;

    for (int cr : ans[0]) {
        cout << cr;

        if (cr == ans[0].back())
            cout << endl;
        else cout << " ";
    }

    for (int cr : ans.back()) {
        cout << cr;

        if (cr == ans.back().back())
            cout << endl;
        else cout << " ";
    }

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Correct 6 ms 384 KB Output is correct
5 Correct 11 ms 384 KB Output is correct
6 Correct 13 ms 384 KB Output is correct
7 Correct 13 ms 288 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -