108632024-04-17 08:48:26Leventusz09Particlescpp17Wrong answer 10/1002.078s6840 KiB
#include <bits/stdc++.h>

using namespace std;

int main(){
    int N, L, K;
    cin >> N;
    cin >> L;
    cin >> K;
    vector<int> Tx(N);
    vector<int> Ty(N);
    vector<int> Vx(N);
    vector<int> Vy(N);
    vector<float> Px(N);
    vector<float> Py(N);

    for(int i=0; i<N; i++){
        cin >> Tx[i];
        cin >> Vx[i];
        Px[i] = Vx[i] * -Tx[i];
    }
    for(int i=0; i<N; i++){
        cin >> Ty[i];
        cin >> Vy[i];
        Py[i] = L + Vy[i] * Ty[i];
    }

    int l = 0;

    int Xm = 0;
    int Ym = L;
    int Xmi = 0;
    int Ymi = 0;
    for(float i=0, d = 0.005, j; l<K; i+=d){
        if(Xm >= Ym){
            l++;
            cout << Xmi + 1 << " " << Ymi + 1 << endl;

            Px[Xmi] = INT_MIN;
            Vx[Xmi] = 0;
            Py[Ymi] = INT_MAX;
            Vy[Ymi] = 0;
        }
        Xm = INT_MIN; Ym = INT_MAX;
        Xmi = -1; Ymi = -1;
        for(j=0; j<N; j++){
            Px[j] += Vx[j]*d;
            if(Px[j] > Xm) Xm = Px[j], Xmi = j;
            Py[j] -= Vy[j]*d;
            if(Py[j] < Ym) Ym = Py[j], Ymi = j;
        }
    }
}
SubtaskSumTestVerdictTimeMemory
subtask110/100
1Accepted5/53ms1808 KiB
2Wrong answer0/541ms2004 KiB
3Accepted5/559ms2500 KiB
4Wrong answer0/5209ms2628 KiB
5Wrong answer0/5531ms2868 KiB
6Wrong answer0/54ms2916 KiB
7Time limit exceeded0/52.078s2664 KiB
8Time limit exceeded0/52.062s3004 KiB
9Time limit exceeded0/52.046s3264 KiB
10Time limit exceeded0/52.071s3424 KiB
11Time limit exceeded0/52.075s3548 KiB
12Time limit exceeded0/52.042s3868 KiB
13Time limit exceeded0/52.062s4200 KiB
14Time limit exceeded0/52.071s4320 KiB
15Time limit exceeded0/52.059s4696 KiB
16Time limit exceeded0/52.055s4676 KiB
17Time limit exceeded0/52.053s4752 KiB
18Time limit exceeded0/52.055s4680 KiB
19Time limit exceeded0/52.053s5012 KiB
20Wrong answer0/590ms6840 KiB