이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#include <algorithm>
using namespace std;
struct emp
{
int n,t;
}d[100001];
int n;
int main (void)
{
int i,j,a,b,num,mxt=0,totn=0,tott=0,temp,temp2;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&d[i].n);
totn+=d[i].n;
}
for(i=0;i<n;i++){
scanf("%d",&d[i].t);
tott+=d[i].t;
}
a=0;
b=1;
num=totn-(d[0].n+d[1].n);
mxt=d[0].t+d[1].t;
for(i=0;i<n;i++){
for(j=i+1;j<n;j++){
temp=totn-(d[i].n+d[j].n);
temp2=d[i].t+d[j].t;
if(mxt*temp>num*temp2){
a=i+1;
b=j+1;
num=temp;
mxt=temp2;
}
}
//printf("%d %d %d %d\n",a,b,num,mxt);
}
printf("%d %d\n",a,b);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |