답안 #84438

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
84438 2018-11-15T07:48:19 Z talip 생물 실험 (IZhO13_expgorl) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
//Yeter calis artik
//Scanf hurmetine. Pls.
char s[10002];
int x[10001], int y[10001];

int main(){
	int a, b, c, d, n, k;
	long double mini=1.0E7, maxi=0, ans;
	scanf("%d %s %d %d %d %d",&k,str+1,&lax,&lay,&gox,&goy);	n=strlen(str+1);
	x[0]=gox-lax;	y[0]=goy-lay;
	for(int i=1;i<=n;i++){
		x[i]=x[i-1];		y[i]=y[i-1];
      	if(s[i]=='I'){
          continue;
        }
      	if(s[i]=='L'){
          	x[i]--;	continue;
        }
      	if(s[i]=='R'){
        	x[i]++;	continue;
      	}
      	if(s[i]=='B'){
        	y[i]--;	continue;
      	}
      	if(s[i]=='F'){
        	y[i]++;	continue;
      	}
	}
	for(int i=0;i<=n;i++){
		for(int j=0;j<k;j++){
			ans=sqrtl(1LL*(x[i]+j*(x[n]-x[0]))*(x[i]+j*(x[n]-x[0]))+1LL*(y[i]+j*(y[n]-y[0]))*(y[i]+j*(y[n]-y[0])));
			if(mini>ans){
              	mini=ans;
            }
			if(ans>maxi){
              	maxi=ans;
            }
		}
	}
	printf("%.14Lf %.14Lf",min,max);
}

Compilation message

expgorl.cpp:6:15: error: expected unqualified-id before 'int'
 int x[10001], int y[10001];
               ^~~
expgorl.cpp: In function 'int main()':
expgorl.cpp:11:31: error: 'str' was not declared in this scope
  scanf("%d %s %d %d %d %d",&k,str+1,&lax,&lay,&gox,&goy); n=strlen(str+1);
                               ^~~
expgorl.cpp:11:38: error: 'lax' was not declared in this scope
  scanf("%d %s %d %d %d %d",&k,str+1,&lax,&lay,&gox,&goy); n=strlen(str+1);
                                      ^~~
expgorl.cpp:11:38: note: suggested alternative: 'maxi'
  scanf("%d %s %d %d %d %d",&k,str+1,&lax,&lay,&gox,&goy); n=strlen(str+1);
                                      ^~~
                                      maxi
expgorl.cpp:11:43: error: 'lay' was not declared in this scope
  scanf("%d %s %d %d %d %d",&k,str+1,&lax,&lay,&gox,&goy); n=strlen(str+1);
                                           ^~~
expgorl.cpp:11:43: note: suggested alternative: 'labs'
  scanf("%d %s %d %d %d %d",&k,str+1,&lax,&lay,&gox,&goy); n=strlen(str+1);
                                           ^~~
                                           labs
expgorl.cpp:11:48: error: 'gox' was not declared in this scope
  scanf("%d %s %d %d %d %d",&k,str+1,&lax,&lay,&gox,&goy); n=strlen(str+1);
                                                ^~~
expgorl.cpp:11:53: error: 'goy' was not declared in this scope
  scanf("%d %s %d %d %d %d",&k,str+1,&lax,&lay,&gox,&goy); n=strlen(str+1);
                                                     ^~~
expgorl.cpp:12:16: error: 'y' was not declared in this scope
  x[0]=gox-lax; y[0]=goy-lay;
                ^
expgorl.cpp:42:32: error: overloaded function with no contextual type information
  printf("%.14Lf %.14Lf",min,max);
                                ^
expgorl.cpp:9:6: warning: unused variable 'a' [-Wunused-variable]
  int a, b, c, d, n, k;
      ^
expgorl.cpp:9:9: warning: unused variable 'b' [-Wunused-variable]
  int a, b, c, d, n, k;
         ^
expgorl.cpp:9:12: warning: unused variable 'c' [-Wunused-variable]
  int a, b, c, d, n, k;
            ^
expgorl.cpp:9:15: warning: unused variable 'd' [-Wunused-variable]
  int a, b, c, d, n, k;
               ^