# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
339281 | 2020-12-25T03:15:10 Z | beksultan04 | 생물 실험 (IZhO13_expgorl) | C++14 | 349 ms | 65540 KB |
#include <bits/stdc++.h> using namespace std; #define int long long #define pii pair<int,int> #define OK puts("OK"); #define NO puts("NO"); #define YES puts("YES"); #define fr first #define sc second #define ret return #define scan1(a) scanf("%lld",&a); #define scan2(a,b) scanf("%lld %lld",&a, &b); #define scan3(a,b,c) scanf("%lld %lld %lld",&a,&b,&c); #define all(s) s.begin(),s.end() #define allr(s) s.rbegin(),s.rend() #define pb push_back #define sz(v) (int)v.size() #define endi puts(""); #define eps 1e-15 const int N = 1e5+12,INF=1e9+7; double disting(double x,double y,double x1,double y1){ ret ((x-x1)*(x-x1))+((y-y1)*(y-y1)); } main(){ double k,i,j,l=0,r=0,x1,y1,x,y,mn,mx; string s,t=""; cin>>k>>s>>x>>y>>x1>>y1; t = s; while (k>1){ s += t; k--; } cout <<fixed <<setprecision(12); mn = disting(x,y,x1,y1); mx = disting(x,y,x1,y1); for (i=0;i<s.size();++i){ if (s[i] == 'L'){ x1--; } if (s[i] == 'R'){ x1++; } if (s[i] == 'F'){ y1++; } if (s[i] == 'B'){ y1--; } mn = min(mn,disting(x,y,x1,y1)); mx = max(mx,disting(x,y,x1,y1)); } cout <<sqrt(mn)<<" "<<sqrt(mx); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 171 ms | 31216 KB | Output is correct |
2 | Correct | 243 ms | 31208 KB | Output is correct |
3 | Correct | 267 ms | 31216 KB | Output is correct |
4 | Correct | 312 ms | 31212 KB | Output is correct |
5 | Correct | 164 ms | 31216 KB | Output is correct |
6 | Correct | 203 ms | 31212 KB | Output is correct |
7 | Correct | 244 ms | 31212 KB | Output is correct |
8 | Correct | 349 ms | 62004 KB | Output is correct |
9 | Runtime error | 81 ms | 65540 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
10 | Halted | 0 ms | 0 KB | - |