QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#637618#7758. Painterzzuqy#Compile Error//C++14895b2024-10-13 13:33:052024-10-13 13:33:08

Judging History

你现在查看的是最新测评结果

  • [2024-10-13 13:33:08]
  • 评测
  • [2024-10-13 13:33:05]
  • 提交

answer

#include<bits/stdc++.h>
#define N 2006
long long x1[N],x2[N],y1[N],y2[N];
int type[N];
char c[N];
int main(){
	int n;
	scanf("%d",&n);
	char s[33],o;
	for(int i=1;i<=n;i++){
		scanf("%s",s);
		if(s[0]=='C'){
			scanf("%lld%lld%lld%c%c",x1+i,y1+i,x2+i,&o,c+i);
			type[i]=1;
		}
		else if(s[2]=='c'){
			scanf("%lld%lld%lld%lld%c%c",x1+i,y1+i,x2+i,y2+i,&o,c+i);
			type[i]=2;
		}
		else{
			scanf("%lld%lld%lld%lld",x1+i,y1+i,x2+i,y2+i);
			for(int y=y2[i];y>=y1[i];y--,puts(""))for(int x=x1[i];x<=x2[i];x++){
				char ans=46;
				for(int j=i-1;j;j--){
					if(type[j]==1){
						if((x-x1[j])*(x-x1[j])+(y-y1[j])*(y-y1[j])<=x2[j]*x2[j]){
							ans=c[j];
							break;
						}
					}
					else if(type[j]==2){
						if(x>=x1[j]&&x<=x2[j]&&y>=y1[j]&&y<=y2[j]){
							ans=c[j];
							break;
						}
					}
				}
				putchar(ans);
			}
		}
	}
	return 0;
}

Details

answer.code:3:27: error: ‘long long int y1 [2006]’ redeclared as different kind of entity
    3 | long long x1[N],x2[N],y1[N],y2[N];
      |                           ^
In file included from /usr/include/features.h:461,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/c++config.h:679,
                 from /usr/include/c++/13/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:33,
                 from answer.code:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:221:1: note: previous declaration ‘double y1(double)’
  221 | __MATHCALL (y1,, (_Mdouble_));
      | ^~~~~~~~~~
answer.code: In function ‘int main()’:
answer.code:13:57: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   13 |                         scanf("%lld%lld%lld%c%c",x1+i,y1+i,x2+i,&o,c+i);
      |                                                       ~~^~
answer.code:13:39: warning: format ‘%lld’ expects argument of type ‘long long int*’, but argument 3 has type ‘double (*)(double) throw ()’ {aka ‘double (*)(double)’} [-Wformat=]
   13 |                         scanf("%lld%lld%lld%c%c",x1+i,y1+i,x2+i,&o,c+i);
      |                                    ~~~^               ~~~~
      |                                       |                 |
      |                                       long long int*    double (*)(double) throw () {aka double (*)(double)}
answer.code:17:61: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   17 |                         scanf("%lld%lld%lld%lld%c%c",x1+i,y1+i,x2+i,y2+i,&o,c+i);
      |                                                           ~~^~
answer.code:17:39: warning: format ‘%lld’ expects argument of type ‘long long int*’, but argument 3 has type ‘double (*)(double) throw ()’ {aka ‘double (*)(double)’} [-Wformat=]
   17 |                         scanf("%lld%lld%lld%lld%c%c",x1+i,y1+i,x2+i,y2+i,&o,c+i);
      |                                    ~~~^                   ~~~~
      |                                       |                     |
      |                                       long long int*        double (*)(double) throw () {aka double (*)(double)}
answer.code:21:57: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   21 |                         scanf("%lld%lld%lld%lld",x1+i,y1+i,x2+i,y2+i);
      |                                                       ~~^~
answer.code:21:39: warning: format ‘%lld’ expects argument of type ‘long long int*’, but argument 3 has type ‘double (*)(double) throw ()’ {aka ‘double (*)(double)’} [-Wformat=]
   21 |                         scanf("%lld%lld%lld%lld",x1+i,y1+i,x2+i,y2+i);
      |                                    ~~~^               ~~~~
      |                                       |                 |
      |                                       long long int*    double (*)(double) throw () {aka double (*)(double)}
answer.code:22:48: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   22 |                         for(int y=y2[i];y>=y1[i];y--,puts(""))for(int x=x1[i];x<=x2[i];x++){
      |                                                ^
answer.code:22:42: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   22 |                         for(int y=y2[i];y>=y1[i];y--,puts(""))for(int x=x1[i];x<=x2[i];x++){
      |                                         ~^~~~~~~
answer.code:26:79: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   26 |                                                 if((x-x1[j])*(x-x1[j])+(y-y1[j])*(y-y1[j])<=x2[j]*x2[j]){
      |                                                                               ^
answer.code:26:74: error: invalid operands of types ‘int’ and ‘double(double) throw ()’ {aka ‘double(double)’} to binary ‘operator-’
   26 |                                                 if((x-x1[j])*(x-x1[j])+(y-y1[j])*(y-y1[j])<=x2[j]*x2[j]){
      |                                                                         ~^~~~~~
      |                                                                         |     |
      |                                                                         int   double(double) throw () {aka double(double)}
answer.code:26:89: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   26 |                                                 if((x-x1[j])*(x-x1[j])+(y-y1[j])*(y-y1[j])<=x2[j]*x2[j]){
      |                                                                                         ^
answer.code:26:84: error: invalid operands of types ‘int’ and ‘double(double) throw ()’ {aka ‘double(double)’} to binary ‘operator-’
   26 |                                                 if((x-x1[j])*(x-x1[j])+(y-y1[j])*(y-y1[j])<=x2[j]*x2[j]){
      |                                                                                   ~^~~~~~
    ...