Submission #1009175

#TimeUsernameProblemLanguageResultExecution timeMemory
1009175tarpentExperiments with Gorlum (IZhO13_expgorl)C++14
0 / 100
1056 ms348 KiB
#include<bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,popcnt,lzcnt,abm,bmi,bmi2,fma,tune=native")
using namespace std;
long long n,gx,gy,lx,ly;
string pu,k;
double mi,ma,tr;
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	
	cin>>n;
	cin>>pu;
	cin>>lx>>ly>>gx>>gy;
	mi= INT_MAX;
	ma=0;
	int siz;
	for(int i = 0; i<pu.size(); i++){
		if(pu[i]=='I'){
			continue;
		}
		k+=pu[i];
		
	}
	char e;
	siz=k.size();
	for(int i = 0; i<n; i++){
		for(int j = 0; j<siz; j++){
			e=k[j];
			if(e=='L'){
				gx-=1;
			}
			else if(e=='R'){
				gx+=1;
			}
			else if(e=='F'){
				gy+=1;
			}
			else if(e=='B'){
				gy-=1;
			}
			else if(e=='I'){
				continue;
			}
			tr=abs(lx-gx)*abs(lx-gx) +abs(ly-gy)*abs(ly-gy);
			
			if(tr<mi) mi = tr;
			
			if(tr>ma) ma = tr;
		}
		
	}
	
	cout<<fixed;
	cout<<setprecision(12);
	cout<<sqrt(mi)<<' '<<sqrt(ma);
	
	
}

Compilation message (stderr)

expgorl.cpp: In function 'int main()':
expgorl.cpp:18:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |  for(int i = 0; i<pu.size(); i++){
      |                 ~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...