August 2022 1 12 Report
НУЖНА ПОМОЩЬ В С++


ВЫДАЕТ Time Limit Exceeded НУЖНО ОПТИМИЗИРОВАТЬ КОД

#include
using namespace std;
int main()
{
int a,b,c,i,y;
cin>>a;
int A[a];
int B[a];
for(i=0;i{
cin>>b;
A[i]=b;
cin>>c;
B[i]=c;
}
for(i=0;i{
for(y=i+1;y{
if(B[y]>B[i] || B[y]==B[i] && A[i]>A[y])
{
c=B[i];
B[i]=B[y];
B[y]=c;
c=A[i];
A[i]=A[y];
A[y]=c;
}
}
}
for(i=0;i
cout<
return 0;
}
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Copyright © 2024 SCHOLAR.TIPS - All rights reserved.