답안 #89112

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
89112 2018-12-10T10:36:55 Z tarash117 생물 실험 (IZhO13_expgorl) C++14
0 / 100
539 ms 66560 KB
#include<bits/stdc++.h>
using namespace std;
map<int,int>d;
int main(){
	ios_base::sync_with_stdio(time);
	cin.tie(0);
	int k;cin>>k;
	string s;
	cin>>s;
	int x1,x2,y1,y2;
	cin>>x1>>y1>>x2>>y2;
	d[0]=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
	int n=s.size();
	for(int i=1;i<=k;i++){
		for(int j=1;j<=n;j++){
		
		if(s[j]=='L')
		x1-=1;
		if(s[j]=='R')
		x1+=1;
		if(s[j]=='F')
		y1+=1;
		if(s[j]=='B')
		y1-=1;
		d[(i-1)*n+j]==sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));}
	}
	int mn=INT_MAX,mx=-1;
	for(int i=0;i<=n*k;i++){
		if(d[i]<mn)
		mn=d[i];
		if(d[i]>mx)
		mx=d[i];
	}
    cout<<fixed<<setprecision(9)<<mn<<' ';
    cout<<fixed<<setprecision(9)<<mx<<' ';
	
	return 0;
}

Compilation message

expgorl.cpp: In function 'int main()':
expgorl.cpp:5:32: warning: the address of 'time_t time(time_t*)' will never be NULL [-Waddress]
  ios_base::sync_with_stdio(time);
                                ^
expgorl.cpp:25:15: warning: value computed is not used [-Wunused-value]
   d[(i-1)*n+j]==sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 539 ms 66560 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -