Submission #89127

# Submission time Handle Problem Language Result Execution time Memory
89127 2018-12-10T10:56:51 Z tarash117 Experiments with Gorlum (IZhO13_expgorl) C++14
0 / 100
376 ms 66560 KB
#include<bits/stdc++.h>
using namespace std;
map<double,double>d;
int main(){
	ios_base::sync_with_stdio(time);
	cin.tie(0);
	int k;cin>>k;
	string s;
	cin>>s;
double 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(10)<<mn<<' ';
    cout<<fixed<<setprecision(10)<<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));}
# Verdict Execution time Memory Grader output
1 Runtime error 376 ms 66560 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -