88022024-01-31 09:22:13Error42Nomekopcpp17Futási hiba 60/1001.498s4648 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 cur;
        cin >> cur;

        ll delta = cur - baseline;

        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;
}
RészfeladatÖsszpontTesztVerdiktIdőMemória
subtask10/0
1Futási hiba3ms1800 KiB
subtask210/10
2Elfogadva3ms1888 KiB
3Elfogadva3ms2084 KiB
subtask330/30
4Elfogadva4ms2168 KiB
5Elfogadva29ms2444 KiB
6Elfogadva28ms2528 KiB
7Elfogadva29ms2680 KiB
8Elfogadva4ms2588 KiB
9Elfogadva28ms2872 KiB
subtask420/20
10Elfogadva101ms3036 KiB
11Elfogadva101ms3136 KiB
12Elfogadva103ms3364 KiB
13Elfogadva101ms3396 KiB
subtask50/40
14Elfogadva1.493s3708 KiB
15Elfogadva1.498s3908 KiB
16Elfogadva1.325s4064 KiB
17Elfogadva1.152s4212 KiB
18Futási hiba4ms4356 KiB
19Futási hiba4ms4580 KiB
20Futási hiba4ms4648 KiB
21Futási hiba4ms4400 KiB