# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
89115 | 2018-12-10T10:40:20 Z | anri | 생물 실험 (IZhO13_expgorl) | C++14 | 1000 ms | 592 KB |
#include<cstdio> #include<cmath> #include<cstring> char str[10002]; int x[10000]; int y[10000]; int main() { int a,b,c,d; int i,j,n,k; long double min=1.0E6,max=0.0,temp; scanf("%d%s%d%d%d%d",&k,str+1,&a,&b,&c,&d); n=strlen(str+1); x[0]=c-a; y[0]=d-b; for(i=1;i<=n;i++) { x[i]=x[i-1]; y[i]=y[i-1]; switch(str[i]) { case 'L': x[i]--; break; case 'R': x[i]++; break; case 'F': y[i]++; break; case 'B': y[i]--; break; } } for(i=0;i<=n;i++) { for(j=0;j<k;j++) { temp=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(temp<min)min=temp; if(temp>max)max=temp; } } printf("%.20Lf %.20Lf",min,max); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 177 ms | 376 KB | Output is correct |
2 | Correct | 241 ms | 444 KB | Output is correct |
3 | Correct | 257 ms | 588 KB | Output is correct |
4 | Correct | 264 ms | 592 KB | Output is correct |
5 | Correct | 140 ms | 592 KB | Output is correct |
6 | Correct | 215 ms | 592 KB | Output is correct |
7 | Correct | 222 ms | 592 KB | Output is correct |
8 | Correct | 307 ms | 592 KB | Output is correct |
9 | Execution timed out | 1075 ms | 592 KB | Time limit exceeded |
10 | Halted | 0 ms | 0 KB | - |