108342024-04-16 12:00:27Leventusz09Particlescpp11Wrong answer 5/1002.099s17320 KiB
#include <bits/stdc++.h>

//#define max(list_) (*max_element(begin(list_), end(list_)))
//#define min(list_) (*min_element(begin(list_), end(list_)))
//#define indexOf(list_, value) (*find(begin(list_), end(list_), value))

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<int> Px(N);
    vector<int> 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;
    vector<vector<int>> O1(K);

    int Xm = 0;
    int Ym = 100;
    int Xmi = 0;
    int Ymi = 0;
    for(int i=0; l<K; i++){
        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(int j=0; j<N; j++){
            Px[j] += Vx[j];
            if(Px[j] > Xm) Xm = Px[j], Xmi = j;
            Py[j] -= Vy[j];
            if(Py[j] < Ym) Ym = Py[j], Ymi = j;
        }
    }
}
SubtaskSumTestVerdictTimeMemory
subtask15/100
1Accepted5/53ms1812 KiB
2Wrong answer0/53ms2012 KiB
3Wrong answer0/53ms2228 KiB
4Wrong answer0/54ms2588 KiB
5Wrong answer0/54ms2824 KiB
6Wrong answer0/54ms3076 KiB
7Time limit exceeded0/52.099s3076 KiB
8Time limit exceeded0/52.081s3376 KiB
9Time limit exceeded0/52.059s4164 KiB
10Time limit exceeded0/52.069s4752 KiB
11Time limit exceeded0/52.058s5552 KiB
12Time limit exceeded0/52.058s6564 KiB
13Time limit exceeded0/52.049s7888 KiB
14Time limit exceeded0/52.061s8720 KiB
15Time limit exceeded0/52.069s10004 KiB
16Time limit exceeded0/52.082s11152 KiB
17Time limit exceeded0/52.065s12240 KiB
18Time limit exceeded0/52.056s13248 KiB
19Time limit exceeded0/52.056s14316 KiB
20Wrong answer0/579ms17320 KiB