16972022-12-01 16:04:57Jano321Forma-1cpp11Wrong answer 0/1002.082s4560 KiB
#include <iostream>
#include <bits/stdc++.h>  

using namespace std;

int main()
{
int n;
cin>>n;
vector<vector<long long int>> AutokAdatatai(n+2);
for(int i=1;i<=n;i++)
{
    //cout<<"i="<<i<<" n="<<n<<endl;
int a,b,c;
cin>>a>>b>>c;
AutokAdatatai[i].push_back(a);
AutokAdatatai[i].push_back(b);
AutokAdatatai[i].push_back(c);
}
int q;
cin>>q;
vector<long long int> Megoldas;
vector<long long int> Helyezesek(n+1);
vector<long long int> Helyezesek2(n+1);
Helyezesek[0]=0;
Helyezesek2[0]=0;
for(int i=0;i<q;i++)
{
    long long int helyezes,T;
    cin>>helyezes>>T;
    long long int T2=T*T;
    for(int j=1;j<=n;j++)
    {
        long long int osszeg5=T2*AutokAdatatai[j][0]+T*AutokAdatatai[j][1]+AutokAdatatai[j][2];
        Helyezesek[j]=osszeg5;
    }
    Helyezesek2=Helyezesek;
    /*cout<<endl<<endl;
    for(int i=1;i<=n;i++)
    {
        cout<<Helyezesek2[i]<<" ";
    }
    cout<<endl;*/

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

    int szam=Helyezesek[n-helyezes+1];   // cout<<szam<<endl<<endl;
    for(int i=1;i<=n;i++)
    {
        if(Helyezesek2[i]==szam)
        {
                Megoldas.push_back(i);
                break;
        }
    }
}
for(int i=0;i<Megoldas.size();i++)
{
    cout<<Megoldas[i]<<endl;
}
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1812 KiB
subtask20/20
2Wrong answer246ms4076 KiB
3Wrong answer215ms3456 KiB
4Wrong answer279ms4560 KiB
5Wrong answer232ms3960 KiB
6Wrong answer127ms3216 KiB
7Wrong answer126ms3292 KiB
8Wrong answer122ms3260 KiB
9Wrong answer120ms3392 KiB
subtask30/30
10Wrong answer460ms4036 KiB
11Wrong answer1.172s3988 KiB
12Time limit exceeded2.065s3372 KiB
13Time limit exceeded2.04s3248 KiB
14Time limit exceeded2.062s3232 KiB
15Time limit exceeded2.056s3736 KiB
16Time limit exceeded2.081s3696 KiB
17Time limit exceeded2.045s3708 KiB
18Time limit exceeded2.075s3864 KiB
subtask40/50
19Time limit exceeded2.078s4200 KiB
20Time limit exceeded2.026s4068 KiB
21Time limit exceeded2.075s4080 KiB
22Time limit exceeded2.062s4016 KiB
23Time limit exceeded2.065s4064 KiB
24Time limit exceeded2.082s4028 KiB
25Time limit exceeded2.068s4080 KiB
26Time limit exceeded2.082s4144 KiB
27Time limit exceeded2.065s4228 KiB
28Time limit exceeded2.073s4052 KiB
29Time limit exceeded2.062s4096 KiB
30Time limit exceeded2.046s4048 KiB