제출 #8134

#제출 시각아이디문제언어결과실행 시간메모리
8134gs13073미술 수업 (IOI13_artclass)C++98
컴파일 에러
0 ms0 KiB
#include<stdio.h> #include<math.h> double val[505][505]; double a,v,sq; int style(int H,int W,int R[500][500],int G[500][500],int B[500][500]) { int i,j,k,l; int A[8][2]={{1,1},{1,0},{1,-1},{-1,1},{-1,0},{-1,-1},{0,1},{0,-1}}; //FILE *out=fopen("1.out","w"); for(i=0;i<H;i++){ for(j=0;j<W;j++){ int cnt=0; double sum=0,tmp=0; int r=R[i][j]; int g=G[i][j]; int b=B[i][j]; for(k=0;k<8;k++){ i+=A[k][0]; j+=A[k][1]; if(i>=0 && i<H && j>=0 && j<W){ tmp=(R[i][j]-r)*(R[i][j]-r) +(G[i][j]-g)*(G[i][j]-g) +(B[i][j]-b)*(B[i][j]-b); tmp=sqrt(tmp); sum+=tmp; cnt++; } i-=A[k][0]; j-=A[k][1]; } val[i][j]=sum/cnt; a+=val[i][j]; sq+=(val[i][j]*val[i][j]); } } a/=(H*W); sq/=(H*W); double b=sq-a*a; //printf("%lf %lf",a,b); if(a*b < 500 )return 4; else if(b>500 && a>30)return 3; else if(b/a > 15)return 1; else return 2; return 0; }

컴파일 시 표준 에러 (stderr) 메시지

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:7:12: warning: unused variable 'l' [-Wunused-variable]
  int i,j,k,l;
            ^
/tmp/ccZKhKYr.o: In function `main':
grader.c:(.text.startup+0x202): undefined reference to `style'
collect2: error: ld returned 1 exit status