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()은 정수를 반환하니 데이터 손실이 있겠네요.
번호 | 제 목 | 글쓴이 | 날짜 |
---|---|---|---|
2692256 | scanf("%*c"); ㅠㅠ 고수님들 | 거북이 | 2025-04-21 |
2692230 | 하노이탑 질문입니다. (1) | 미쁘다 | 2025-04-21 |
2692210 | 정보 올림피아드 문제인데.. 풀이 과정이 궁금합니다.(재귀함수) (5) | 물티슈 | 2025-04-20 |
2692144 | C언어와 리눅스에 대한 질문입니다. | 싴흐한세여니 | 2025-04-20 |
2692114 | 컨텍스트 스위칭하는데 걸리는 시간 측정.. | YourWay | 2025-04-19 |
2692086 | 간접참조 연산자, 증감연산자 질문이용! (2) | 블랙캣 | 2025-04-19 |
2692056 | 주석좀 달아주세요. 몇개적엇는데 몇개만달아주세요. (2) | DevilsTears | 2025-04-19 |
2691978 | 진수 쉽게 이해하는법... (3) | 지지않는 | 2025-04-18 |
2691949 | getchar() 한 문자를 입력받는 함수 질문 | 채꽃 | 2025-04-18 |
2691919 | 배열 정렬 및 합치기 질문입니다. | 사과 | 2025-04-18 |
2691845 | c언어왕초보 질문이 있습니다........ | 루나 | 2025-04-17 |
2691815 | void add(int num); 함수... (4) | 살랑살랑 | 2025-04-17 |
2691756 | 명령 프롬프트 스크롤바가 없어요 | 두메꽃 | 2025-04-16 |
2691725 | 자료구조에 관련해서 질문이 있어 글을 올립니다. | 누리알찬 | 2025-04-16 |
2691697 | if 문에서 구조체 배열에 저장되있던 문자열 검사하는 법 ? (2) | 민트맛사탕 | 2025-04-16 |
2691678 | C언어 함수 질문이요~!!! | 연보라 | 2025-04-15 |
2691650 | 반복문 | 돋가이 | 2025-04-15 |
2691618 | 링크드리스트 개념 질문이예요 (3) | 맨마루 | 2025-04-15 |
2691592 | 동적할당 이용 배열선언 질문입니다.ㅠㅠ (3) | 허리달 | 2025-04-15 |
2691542 | /=의 용도를 알려주세요 ㅠㅠ! (2) | 아라 | 2025-04-14 |