17002022-12-01 16:11:10Jano321Forma-1cpp11Wrong answer 0/1002.099s5392 KiB
#include <iostream>
#include <bits/stdc++.h>  

using namespace std;

int main()
{
int n;
cin>>n;
vector<vector<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<int> Megoldas;
vector<float> Helyezesek(n+1);
vector<float> Helyezesek2(n+1);
Helyezesek[0]=0;
Helyezesek2[0]=0;
for(int i=0;i<q;i++)
{
    int helyezes,T;
    cin>>helyezes>>T;
    for(int j=1;j<=n;j++)
    {float osszeg5=0;
        if(T!=0){
        osszeg5=T*AutokAdatatai[j][0]+AutokAdatatai[j][1]+AutokAdatatai[j][2]/T;
        }
        else
        {
            osszeg5=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
1Accepted3ms1808 KiB
subtask20/20
2Wrong answer418ms4028 KiB
3Wrong answer561ms4396 KiB
4Wrong answer564ms4460 KiB
5Wrong answer479ms4528 KiB
6Accepted514ms4716 KiB
7Accepted556ms4848 KiB
8Wrong answer508ms5056 KiB
9Wrong answer503ms5392 KiB
subtask30/30
10Wrong answer446ms3864 KiB
11Wrong answer1.342s3700 KiB
12Time limit exceeded2.049s3172 KiB
13Time limit exceeded2.065s3132 KiB
14Time limit exceeded2.056s3336 KiB
15Time limit exceeded2.049s3280 KiB
16Time limit exceeded2.073s3280 KiB
17Time limit exceeded2.069s3236 KiB
18Time limit exceeded2.085s3300 KiB
subtask40/50
19Time limit exceeded2.059s3656 KiB
20Time limit exceeded2.042s3256 KiB
21Time limit exceeded2.099s3536 KiB
22Time limit exceeded2.053s3672 KiB
23Time limit exceeded2.062s3700 KiB
24Time limit exceeded2.066s3744 KiB
25Time limit exceeded2.069s3684 KiB
26Time limit exceeded2.078s3672 KiB
27Time limit exceeded2.062s3880 KiB
28Time limit exceeded2.058s3884 KiB
29Time limit exceeded2.069s4004 KiB
30Time limit exceeded2.078s3764 KiB