88012024-01-31 09:17:27Error42Nomekopcpp17Runtime error 0/1001.503s4940 KiB
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

using ll = long long;

struct nomekop {
    ll pos, delta_attack, companion;
};

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

    ll n;
    cin >> n;

    vector<ll> a(n);
    for (ll& x : a)
        cin >> x;

    cout << "?";

    for (int i = 0; i < n; i++)
        cout << " " << a[i];

    cout << endl;

    ll baseline;
    cin >> baseline;

    vector<nomekop> opponents(n);

    for (int i = 1; i < n; i++) {
        cout << "? " << a[i];
        
        for (int j = 1; j < n; j++) {
            cout << " ";
            if (i == j)
                cout << a[0];
            else
                cout << a[j];
        }

        cout << endl;

        ll delta;
        cin >> delta;

        opponents[i].pos = i;
        opponents[i].delta_attack = delta / (a[0] - a[i]);
    }

    sort(opponents.begin(), opponents.end(), [&](nomekop const& a, nomekop const& b) {
        return a.delta_attack < b.delta_attack;
    });

    sort(a.begin(), a.end());

    for (int i = 0; i < n; i++)
        opponents[i].companion = a[i];

    sort(opponents.begin(), opponents.end(), [&](nomekop const& a, nomekop const& b) {
        return a.pos < b.pos;
    });

    cout << "!";

    for (nomekop const& x : opponents)
        cout << x.companion << " ";
    cout << endl;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Runtime error3ms1924 KiB
subtask20/10
2Wrong answer3ms2160 KiB
3Wrong answer3ms2392 KiB
subtask30/30
4Wrong answer4ms2476 KiB
5Wrong answer29ms2564 KiB
6Wrong answer28ms2564 KiB
7Wrong answer28ms2820 KiB
8Wrong answer4ms2884 KiB
9Wrong answer28ms3248 KiB
subtask40/20
10Wrong answer103ms3384 KiB
11Wrong answer101ms3604 KiB
12Wrong answer101ms3604 KiB
13Wrong answer103ms4012 KiB
subtask50/40
14Wrong answer1.496s4120 KiB
15Wrong answer1.503s4588 KiB
16Wrong answer1.325s4148 KiB
17Wrong answer1.154s4940 KiB
18Runtime error4ms4528 KiB
19Runtime error4ms4524 KiB
20Runtime error4ms4528 KiB
21Runtime error4ms4640 KiB