ACM 문제!
이하얀
질문 제목 :
http://livearchive.onlinejudge.org/index.php?option=com_onlinejudge&page=show_problem&problem=2250
이문제인데요 풀었는데 워롱엔서래요ㅠㅠ질문 내용 :
#include stdio.h
#include math.h
float a[7]={9.23076, 1.84523, 56.0211, 4.99087, 0.188807, 15.9803, 0.
float b[7]={26.7, 75, 1.5, 42.5, 210, 3.8, 254};
float c[7]={1.835, 1.348, 1.05, 1.81, 1.41, 1.04, 1.88};
int run(int p,int i);
int fil(int p,int i);
int main(void)
{
int tot,i,j,ts=0;
int gr[7];
int gs[7];
scanf(%d,&tot);
for (i=0; itot; i++){
for (j=0; j7; j++)
scanf(%d,&gr[j]);
gs[0]=run(gr[0],0);
gs[1]=fil(gr[1],1);
gs[2]=fil(gr[2],2);
gs[3]=run(gr[3],3);
gs[4]=fil(gr[4],4);
gs[5]=fil(gr[5],5);
gs[6]=run(gr[6],6);
for (j=0; j7; j++)
ts+=gs[j];
printf(%d,ts);
ts=0;
}
return 0;
}
int run(int p, int i)
{
int sc=0;
sc=a[i]*pow((b[i]-p),c[i]);
return sc;
}
int fil(int p, int i)
{
int sc=0;
sc=a[i]*pow((p-b[i]),c[i]);
return sc;
}hi,
this is an automated response from acm-icpc live archive.
your submission with number 869897 for the problem 4249 - heptathlon has failed with verdict wrong answer.
although your program was successful at compilation and execution stages, it was not able of solving the proposed problem.
best regards,
the acm-icpc live archive team이렇게 말하내요ㅠㅠ뭐가문제죠?
-
피스케스
A 배열이 닫기지 않았습니다.
-
샹1큼해
로그인 하라는데, 무슨 문제인지 모르겠네요.
그냥 코드만 봤을 땐, A[], B[], C[] 는 float형을 다루는데
fil(), run()은 정수를 반환하니 데이터 손실이 있겠네요.