17052022-12-01 16:16:33Jano321Forma-1cpp11Wrong answer 0/1002.094s388200 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);
vector<vector<float>> IdoHelyezesek(1000002);
Helyezesek[0]=0;
Helyezesek2[0]=0;
for(int i=0;i<q;i++)
{
    int helyezes,T;
    cin>>helyezes>>T;
    if(IdoHelyezesek[T].size()==0){
    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;
    }
    }
    else
    {
        Helyezesek=IdoHelyezesek[T];

    }
    Helyezesek2=Helyezesek;
    IdoHelyezesek[T]=Helyezesek2;
    /*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
1Accepted19ms48652 KiB
subtask20/20
2Wrong answer501ms73656 KiB
3Wrong answer626ms74192 KiB
4Wrong answer470ms74396 KiB
5Wrong answer588ms74596 KiB
6Accepted490ms74804 KiB
7Accepted611ms74600 KiB
8Wrong answer460ms74828 KiB
9Wrong answer474ms74876 KiB
subtask30/30
10Wrong answer476ms206580 KiB
11Wrong answer1.394s206520 KiB
12Time limit exceeded2.055s210732 KiB
13Time limit exceeded2.049s162088 KiB
14Time limit exceeded2.052s156172 KiB
15Time limit exceeded2.056s147512 KiB
16Time limit exceeded2.073s140476 KiB
17Time limit exceeded2.085s150096 KiB
18Time limit exceeded2.075s140092 KiB
subtask40/50
19Time limit exceeded2.094s388200 KiB
20Time limit exceeded2.075s145616 KiB
21Time limit exceeded2.068s216668 KiB
22Time limit exceeded2.059s160200 KiB
23Time limit exceeded2.078s157140 KiB
24Time limit exceeded2.073s148444 KiB
25Time limit exceeded2.055s138792 KiB
26Time limit exceeded2.073s151756 KiB
27Time limit exceeded2.089s142008 KiB
28Time limit exceeded2.082s145268 KiB
29Time limit exceeded2.092s155184 KiB
30Time limit exceeded2.078s158812 KiB