답안 #1009152

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1009152 2024-06-27T09:24:26 Z tarpent 생물 실험 (IZhO13_expgorl) C++14
0 / 100
1000 ms 428 KB
#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;
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;
	char e;
	siz = pu.size();
	for(int i = 0; i<n; i++){
		for(int j = 0; j<siz; j++){
			e=pu[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;
	mi=sqrt(mi);
	ma=sqrt(ma);
	cout<<setprecision(12);
	cout<<mi<<' '<<ma;
	
	
}
# 결과 실행 시간 메모리 Grader output
1 Correct 49 ms 344 KB Output is correct
2 Correct 64 ms 344 KB Output is correct
3 Correct 79 ms 428 KB Output is correct
4 Correct 76 ms 344 KB Output is correct
5 Correct 39 ms 348 KB Output is correct
6 Correct 58 ms 348 KB Output is correct
7 Correct 64 ms 348 KB Output is correct
8 Correct 88 ms 348 KB Output is correct
9 Execution timed out 1043 ms 344 KB Time limit exceeded
10 Halted 0 ms 0 KB -