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()은 정수를 반환하니 데이터 손실이 있겠네요.
번호 | 제 목 | 글쓴이 | 날짜 |
---|---|---|---|
2685477 | 소수점이하 출력하는거요 | 널위해 | 2025-02-18 |
2685449 | printf배우고있는데요 궁금한게있어요 (8) | 꽃큰 | 2025-02-18 |
2685393 | c언어 질문이요.... | 붕붕 | 2025-02-18 |
2685365 | 윈도우7에서 visual studio c++6.0 (1) | 빛길 | 2025-02-17 |
2685317 | segmentation fault가 나요 | 가람 | 2025-02-17 |
2685292 | 다중스택질문 | 올해1살 | 2025-02-17 |
2685231 | C언어와 닷넷에 대해서 질문!! (2) | 설아 | 2025-02-16 |
2685206 | VisualBasic 과 DEV++ 의 장단점과 만든 파일 호환 가능하나요? | 에드워드 | 2025-02-16 |
2685154 | 배열 크기조절 | 해찬솔 | 2025-02-15 |
2685124 | 수정이거 제가 뭐가 잘못한거죠 ? | 아이돌 | 2025-02-15 |
2685096 | 포인터의 고수분들 모두 보세요!! 제발 ㅠ_ㅠ 헷갈려헷갈려..갈려헷.. (7) | 치킨마루 | 2025-02-15 |
2685045 | 전처리기 질문 | 치에미 | 2025-02-14 |
2685016 | 오류 좀 확인해 주시면 감사하겠습니다 | 초코맛사탕 | 2025-02-14 |
2684917 | 알고리즘을 이용한 행렬의 전치// 문제다운 문제네요. | 뿡뿡 | 2025-02-13 |
2684868 | 양방향 연결리스트에서 실행도중 죽는 이유좀 찾아주세요. (2) | 예다움 | 2025-02-13 |
2684844 | 시계프로그램인데 도저히 모르겠어요ㅠ (1) | 비내리던날 | 2025-02-12 |
2684812 | 레포트좀도와주세요ㅠㅠ (2) | 갈매빛 | 2025-02-12 |
2684780 | 채팅창 흉내내보려고하는데요 ㅜ.ㅜ (1) | 바름 | 2025-02-12 |
2684729 | 내일 시험인데 메모리 그리는것좀 도와주세요 ㅠ (1) | 상처주지마 | 2025-02-11 |
2684701 | 버퍼 관련 질문 3가지 (이전거랑 달라요) | 한국녀 | 2025-02-11 |